Hi,
we have migrated our users from a manifest v2 to manifest v3 extension a few weeks ago. One of the main changes on the browser side is that the background script used to run all the time. Now, in manifest v3, it can be shut down and restarted any time. For some users, we observe the background script being started every two minutes.
Because of the restarts, the background script relies on chrome.storage to persist state. However, we observe that the storage is not 100% reliable and any state, including credentials, may disappear. We have confirmed that chrome.storage.local may not be defined and only appears after a few hundred milliseconds. But even then, we are observing read and write errors on chrome.storage.local.get and chrome.storage.local.set.
Combined, theses issues would happen in around 0.1% of background script starts, which doesn't look like a big deal. However, it seems that with the same latest Chrome, some users are affected significantly more than others and combined with fairly frequent restarts of the background script, it significantly affects the daily user experience.
Would you advise any alternatives to chrome.storage.local to persist the state or anything else we can do on the extension side?
Pavel