Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile: Fix plugins aren't visible after switching to a new profile #10386

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

Fixes an issue where plugins weren't visible in settings after switching to a new profile, despite being installed.

Note: Review #10348 first.

Notes

Important

This pull request builds on the changes made in #10348 (which has not yet been merged). This is done to avoid a regression that would cause the background webview to load even when no plugins are installed/plugin support has not been enabled.

Previously, the background plugin runner WebView was loaded only if settings existed for at least one plugin:

const hasPlugins = Object.values(pluginSettings).length > 0;

This may not be the case if the user switches profiles, in which case this setting would be empty. However, plugins are still installed and installing one additional plugin would cause all plugins to be loaded.

The PluginStates setting screen previously also relied on pluginSettings. As a result, plugins installed in a different profile could run in the background with no UI in the plugin settings screen. This has been fixed by making PluginStates get information about the loaded plugins directly from PluginService rather than from settings and Redux state.

Testing

This pull request has an automated test. The test checks that installing and uninstalling plugins updates the plugin settings screen.

To test this manually,

  1. Open a profile with existing plugins.
  2. Install a new plugin (tested with the CodeMirror 6 Snippets plugin).
  3. Switch to a new profile.
  4. Enable plugin support in settings.
  5. Verify that all plugins from the previous profile are visible in settings.
  6. Delete the plugin installed in step 2, verify that it is removed from the list in settings.

This has been tested successfully tested on Android 13.

@laurent22
Copy link
Owner

#10348 is merged now but as a result there are some conflicts

@laurent22 laurent22 merged commit d5fa8d0 into laurent22:dev May 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants