Fix bug with unnecessary plugin auto-update attempts
Summary: I've noticed that Flipper is trying to schedule auto-update for some plugins on every startup even though they are already updated. I found this happens because of a race condition when the auto-updater can be triggered before plugins initialised. This diff fixes that. Reviewed By: passy Differential Revision: D28312086 fbshipit-source-id: 66b0bd2aa9dfede1737d565b1e7e7845c940405e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
32f276b499
commit
0dce247741
@@ -22,6 +22,7 @@ import {
|
||||
registerBundledPlugins,
|
||||
registerMarketplacePlugins,
|
||||
MarketplacePluginDetails,
|
||||
pluginsInitialised,
|
||||
} from '../reducers/plugins';
|
||||
import GK from '../fb-stubs/GK';
|
||||
import {FlipperBasePlugin} from '../plugin';
|
||||
@@ -106,6 +107,7 @@ export default async (store: Store, logger: Logger) => {
|
||||
store.dispatch(addDisabledPlugins(disabledPlugins));
|
||||
store.dispatch(addFailedPlugins(failedPlugins));
|
||||
store.dispatch(registerPlugins(initialPlugins));
|
||||
store.dispatch(pluginsInitialised());
|
||||
|
||||
sideEffect(
|
||||
store,
|
||||
@@ -165,7 +167,7 @@ function getBundledPlugins(): Array<BundledPluginDetails> {
|
||||
try {
|
||||
bundledPlugins = global.electronRequire(pluginPath);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.error('Failed to load bundled plugins', e);
|
||||
}
|
||||
|
||||
return bundledPlugins;
|
||||
|
||||
Reference in New Issue
Block a user