Fix bug with plugin re-installation after uninstallation
Summary: Fixed a bug when plugin installation status wouldn't be saved between sessions when plugin uninstalled and then re-installed again. Before the fix, after Flipper restart, such plugin was uninstalled again because its package name was not removed from "uninstalledPlugins" state. This was because plugin id was used by mistake instead of name in few places. To try avoiding this issue in future I've also renamed "uninstalledPlugins" to "uninstalledPluginNames" to make it more clear than package name should be used there rather than ID. As this field is persisted, I also added migration which moves data to the renamed field. Reviewed By: passy Differential Revision: D28314447 fbshipit-source-id: fbe3edc258b78fe7fbb0d966f93aabcdf3b66d4b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
22974130c8
commit
00851c6b5d
@@ -85,14 +85,15 @@ export default async (store: Store, logger: Logger) => {
|
||||
),
|
||||
);
|
||||
|
||||
const uninstalledPlugins = store.getState().plugins.uninstalledPlugins;
|
||||
const uninstalledPluginNames =
|
||||
store.getState().plugins.uninstalledPluginNames;
|
||||
|
||||
const bundledPlugins = getBundledPlugins();
|
||||
|
||||
const loadedPlugins = filterNewestVersionOfEachPlugin(
|
||||
bundledPlugins,
|
||||
await getDynamicPlugins(),
|
||||
).filter((p) => !uninstalledPlugins.has(p.name));
|
||||
).filter((p) => !uninstalledPluginNames.has(p.name));
|
||||
|
||||
const initialPlugins: PluginDefinition[] = loadedPlugins
|
||||
.map(reportVersion)
|
||||
|
||||
Reference in New Issue
Block a user