-
-
Notifications
You must be signed in to change notification settings - Fork 592
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
Prevent overlapping sync accumulator persists #2392
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add a flag to stop the sync worker trying to persist to indexeddb if there are already persists in flight. accumulates user presence updates in RAM to stop them being lost if the persist is skipped. hopefully fixes https://github.com/vector-im/element-web/issues/21541
SimonBrandner
approved these changes
May 21, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM!
t3chguy
reviewed
May 21, 2022
going to merge this so i don't have to run a custom Nightly to see if it's fixed things. |
su-ex
added a commit
to SchildiChat/matrix-js-sdk
that referenced
this pull request
Jun 7, 2022
* Convert `getLocalAliases` to a stable API call ([\matrix-org#2402](matrix-org#2402)). * Fix request, crypto, and bs58 imports ([\matrix-org#2414](matrix-org#2414)). Fixes matrix-org#2415. * Update relations after every decryption attempt ([\matrix-org#2387](matrix-org#2387)). Fixes element-hq/element-web#22258. Contributed by @weeman1337. * Fix degraded mode for the IDBStore and test it ([\matrix-org#2400](matrix-org#2400)). Fixes matrix-org/element-web-rageshakes#13170. * Don't cancel SAS verifications if `ready` is received after `start` ([\matrix-org#2250](matrix-org#2250)). * Prevent overlapping sync accumulator persists ([\matrix-org#2392](matrix-org#2392)). Fixes vector-im/element-web#21541. * Fix behaviour of isRelation with relation m.replace for state events ([\matrix-org#2389](matrix-org#2389)). Fixes element-hq/element-web#22280. * Fixes matrix-org#2384 ([\matrix-org#2385](matrix-org#2385)). Fixes undefined/matrix-js-sdk#2384. Contributed by @schmop. * Ensure rooms are recalculated on re-invites ([\matrix-org#2374](matrix-org#2374)). Fixes element-hq/element-web#22106.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a flag to stop the sync worker trying to persist to indexeddb if there is already a persist in flight. This means that if indexeddb is being very slow (e.g. due to the browser running for a few seconds every ~10 mins while a macbook is asleep), you won't end up with overlapping write operations to indexeddb which could consume heap and cause an OOM. It's okay to do this in the sync worker rather than the main thread, as it turns out that all the accumulation happens inside the worker, so we never pass large accumulated sync responses over postmessage to the worker.
If the persist is skipped, we accumulate user presence updates in RAM to stop them being lost (given the sync accumulator doesn't handle them itself for some reason).
Hopefully fixes element-hq/element-desktop#680
Here's what your changelog entry will look like:
🐛 Bug Fixes