Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #468 and #470
The problem
New release 6.0.0 does not work for some chrome users.
Investigation revealed 2 problem:
Config are broken for some users
According to the user report, property
appConfig
contains only one value.While debugging been found the root cause of this bug, our config migrations use an async calls for methods in
browser.storage.local
, but some migrations does not useawait
keyword, that make possible a race condition where storage value overwrites multiple times in not determined order, so result value is unpredictable.We did not catch a bug, because tests uses a mocked extensions API from package https://github.com/RickyMarou/jest-webextension-mock where did not implemented a random delays, so our tests did not imitate a case when promises resolves with different delays.
Also, it is important to mention that bug been occurred not for all users, but only for some users (we don't know the numbers, unfortunately). No one my personal PC did not reproduce a bug.
Old chrome versions does not have a constants with reasons for offscreen documents creation
One of user reports contains the error below:
User report that environment is "Windows 7 pro and chrome 109 portable".
Even considering legacy OS and browser version, we found that chrome 109 release date is "January 10, 2023" that is only 1.5 years ago, so we should support such browsers when it possible.
It looks the problem here is chrome 109 does not have a dictionary in property
chrome.offscreen.Reason
.The solution
The first problem with invalid config is pretty dangerous. Our changes to fix it is:
await
keywords in migrations, to prevent a problem for the futureFor the second problem we replaced constant values to a string literals