Only store messages for plugins that are starred

Summary:
From several reviews / early feedbacks it was suggested several times to use the star mechanism to distinguish which plugins are allowed to send messages. This diff implements that:

- If a plugin is not selected, and not starred, it will drop the messages it received in the background
- This logic is still behind the same GK
- I think this change warrants upping the message queue limits significantly
- A future optimization would be to disable sending messages from the device side of things to reduce bridge usage, but that change is probably a lot more complicated with less impact
- In the next diff I'll make clear from UI perspective that unstarred plugins don't queue messages

In the attach video one can see how graphQL plugin keeps storing messages if it is starred, but if it isn't starred and not selected either, it will skip messages

{F225692819}

Reviewed By: jknoxville

Differential Revision: D19250928

fbshipit-source-id: 7e6af0eb6830dc79951cfd206e05b44061f1b14a
This commit is contained in:
Michel Weststrate
2020-01-02 07:12:06 -08:00
committed by Facebook Github Bot
parent 1caf5d5d3a
commit 04fcaddded
5 changed files with 140 additions and 81 deletions

View File

@@ -34,12 +34,12 @@ export function pluginsClassMap(
}
export function getPluginKey(
selectedApp: string | null,
selectedAppId: string | null,
baseDevice: BaseDevice | null,
pluginID: string,
): string {
if (selectedApp) {
return `${selectedApp}#${pluginID}`;
if (selectedAppId) {
return `${selectedAppId}#${pluginID}`;
}
if (baseDevice) {
// If selected App is not defined, then the plugin is a device plugin