-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: wait for logout to be completed when handling user events [WPB-9689] [WPB-10310] #2914
Merged
MohamadJaara
merged 3 commits into
release/candidate
from
fix/wait-for-logout-when-handling-user-events
Jul 30, 2024
Merged
fix: wait for logout to be completed when handling user events [WPB-9689] [WPB-10310] #2914
MohamadJaara
merged 3 commits into
release/candidate
from
fix/wait-for-logout-when-handling-user-events
Jul 30, 2024
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
echoes-hq
bot
added
the
echoes: unplanned
Any work item that isn’t part of the product or technical roadmap.
label
Jul 29, 2024
Datadog ReportBranch report: ✅ 0 Failed, 3029 Passed, 105 Skipped, 14.19s Total Time |
saleniuk
requested review from
a team,
typfel,
yamilmedina,
MohamadJaara,
mchenani and
Garzas
and removed request for
a team
July 30, 2024 07:59
vitorhugods
approved these changes
Jul 30, 2024
alexandreferris
approved these changes
Jul 30, 2024
yamilmedina
approved these changes
Jul 30, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to no response for status checks
Jul 30, 2024
Quality Gate passedIssues Measures |
github-actions bot
pushed a commit
that referenced
this pull request
Jul 30, 2024
…689] [WPB-10310] (#2914) Co-authored-by: Vitor Hugo Schwaab <[email protected]> Co-authored-by: Mohamad Jaara <[email protected]>
Merged
7 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jul 30, 2024
…689] [WPB-10310] 🍒 (#2919) * fix: wait for logout to be completed when handling user events [WPB-9689] [WPB-10310] (#2914) Co-authored-by: Vitor Hugo Schwaab <[email protected]> Co-authored-by: Mohamad Jaara <[email protected]> * trigger build --------- Co-authored-by: Michał Saleniuk <[email protected]> Co-authored-by: Vitor Hugo Schwaab <[email protected]> Co-authored-by: Mohamad Jaara <[email protected]> Co-authored-by: Michał Saleniuk <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
echoes: unplanned
Any work item that isn’t part of the product or technical roadmap.
👕 size: XS
type: bug / fix 🐞
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.
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
When the app is in the background and the current client is removed from other client, then when launching the app there's a crash.
Causes (Optional)
ProteusPreKeyRefiller
always launches when sync completes (when incremental sync state is changed toLive
) and itrequires core crypto to generate new pre keys, but when the app received
User.ClientRemove
event and started handling it as an "offline event" (before sync isLive
) then core crypto may be removed before or during executing the refiller.Generally I noticed three possible outcomes:
Just the first one ends up crashing the app,
ProteusException
s are handled quietly and don't crash the app, so depending on what happens first, it can crash or handle it without a crash.Solutions
We shouldn't start refilling pre keys if the core crypto / client is already removed.
Even more - we shouldn't execute any action after sync or handle any other event after receiving
User.ClientRemove
orUser.UserDelete
event.The solution is easy - add
waitUntilCompletes = true
when when executinglogout
during handlingUser.ClientRemove
orUser.UserDelete
event. This way, when the app starts the logout, it should actually wait for the logout to be completed before any other event is handled, so it will close the user session and related coroutine scope and prevent the app from handling subsequent events and doing any actions after the sync is completed.Testing
Test Coverage (Optional)
How to Test
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.