Silence background plugin timeout

Summary:
This isn't actionable and can't be deduplicated due to the device identifier.

Changelog: Don't report errors related to timeouts of background plugins

Reviewed By: lblasa

Differential Revision: D48467028

fbshipit-source-id: 94f32848962d8d3e3b1998a88f6f30a6cf86c4f6
This commit is contained in:
Pascal Hartig
2023-08-21 04:00:56 -07:00
committed by Facebook GitHub Bot
parent 160b05a5bd
commit f6fcc1635f

View File

@@ -226,8 +226,17 @@ export default abstract class AbstractClient extends EventEmitter {
this.startPluginIfNeeded(await this.getPlugin(pluginId)), this.startPluginIfNeeded(await this.getPlugin(pluginId)),
), ),
); );
const newBackgroundPlugins = await this.getBackgroundPlugins(); let newBackgroundPlugins: PluginsArr = [];
try {
newBackgroundPlugins = await this.getBackgroundPlugins();
this.backgroundPlugins = new Set(newBackgroundPlugins); this.backgroundPlugins = new Set(newBackgroundPlugins);
} catch (e: unknown) {
if ((e as Error).message.includes('timeout')) {
console.warn(e);
} else {
throw e;
}
}
// diff the background plugin list, disconnect old, connect new ones // diff the background plugin list, disconnect old, connect new ones
oldBackgroundPlugins.forEach((plugin) => { oldBackgroundPlugins.forEach((plugin) => {
if (!this.backgroundPlugins.has(plugin)) { if (!this.backgroundPlugins.has(plugin)) {