From 1caf5d5d3a670530bfe25b3d19d6e4a515d4bf2f Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Thu, 2 Jan 2020 07:12:06 -0800 Subject: [PATCH] Fix regression in background state Summary: `flipperPrintPluginBackgroundStats()` tended to report the class name rather than the given plugin id Reviewed By: jknoxville Differential Revision: D19250706 fbshipit-source-id: 6035892bacf6a592d8c510320d5e003fac580ec7 --- src/utils/messageQueue.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/messageQueue.tsx b/src/utils/messageQueue.tsx index 27639d5ab..feefe689d 100644 --- a/src/utils/messageQueue.tsx +++ b/src/utils/messageQueue.tsx @@ -74,12 +74,12 @@ function processMessage( state: State, pluginKey: string, plugin: { - name: string; + id: string; persistedStateReducer: PersistedStateReducer | null; }, message: {method: string; params?: any}, ): State { - const statName = `${plugin.name}.${message.method}`; + const statName = `${plugin.id}.${message.method}`; const reducerStartTime = Date.now(); flipperRecorderAddEvent(pluginKey, message.method, message.params); try { @@ -91,7 +91,7 @@ function processMessage( addBackgroundStat(statName, Date.now() - reducerStartTime); return newPluginState; } catch (e) { - console.error(`Failed to process event for plugin ${plugin.name}`, e); + console.error(`Failed to process event for plugin ${plugin.id}`, e); return state; } } @@ -101,7 +101,7 @@ export function processMessageImmediately( pluginKey: string, plugin: { defaultPersistedState: any; - name: string; + id: string; persistedStateReducer: PersistedStateReducer | null; }, message: {method: string; params?: any}, @@ -131,7 +131,7 @@ export function processMessageLater( pluginKey: string, plugin: { defaultPersistedState: any; - name: string; + id: string; persistedStateReducer: PersistedStateReducer | null; maxQueueSize?: number; }, @@ -169,7 +169,7 @@ export function processMessageLater( export async function processMessageQueue( plugin: { defaultPersistedState: any; - name: string; + id: string; persistedStateReducer: PersistedStateReducer | null; }, pluginKey: string,