-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[PM-5584] Set up a stay alive method to allow service worker in manifest v3 to stay alive indefinitely #8535
Conversation
…est v3 to stay alive indefinitely
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8535 +/- ##
=======================================
Coverage 26.89% 26.90%
=======================================
Files 2311 2311
Lines 67465 67436 -29
Branches 12642 12641 -1
=======================================
- Hits 18148 18142 -6
+ Misses 47924 47901 -23
Partials 1393 1393 ☔ View full report in Codecov by Sentry. |
…me-to-allow-extension-to-stay-alive-indefinitely-in-manifest-v3
New Issues
|
Why is this the case? Does this approach have some limitation / unsupported edge case? Do we expect it to be patched? |
This is a supported work around to concerns that the extension development community has had regarding service worker lifetimes, and issues with having a non-persistent background script. This is a temporary solution to a larger architectural issue that the extension is experiencing. To facilitate accommodation of a non-persistent runtime environment, we need to refactor the instantiation of background services to function through a dependency injection container. We also need to rework all browser extension event listeners to register at the top level of the background script execution context. These code changes are a temporary way to ensure we can have a functioning extension in manifest v3 before those larger architectural changes are implemented. Also, it's possible that we will use this persistence "hack" in certain situations, even with the refactor. The scenarios that come to mind revolve around import/export of vault data, among other unknown use cases. |
…me-to-allow-extension-to-stay-alive-indefinitely-in-manifest-v3
…me-to-allow-extension-to-stay-alive-indefinitely-in-manifest-v3
…me-to-allow-extension-to-stay-alive-indefinitely-in-manifest-v3
…me-to-allow-extension-to-stay-alive-indefinitely-in-manifest-v3
…me-to-allow-extension-to-stay-alive-indefinitely-in-manifest-v3
Type of change
Objective
This PR introduces code changes that facilitates a persistent service worker lifetime within the manifest v3 version of the extension. This is a temporary hack that we will use until we solidify our approach to handling the ephemeral nature of the background service worker in a more robust manner.
Code changes
MainBackground
class to ensure that we trigger a keep alive process when the extension is running within manifest v3.