fix: sync is suspended when call ends in foreground - WPB-25064 🍒#4638
Merged
Conversation
johnxnguyen
approved these changes
Apr 27, 2026
Contributor
Author
Test Results 1 files 133 suites 1m 23s ⏱️ For more details on these failures, see this check. Results for commit c4a52e0. ♻️ This comment has been updated with latest results. Summary: workflow run #25304664384 |
zenkins
approved these changes
May 4, 2026
zenkins
left a comment
Collaborator
There was a problem hiding this comment.
✅ Auto-approved cherry-pick PR 🍒.
|
This file contains hidden or 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
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.



This PR was automatically cherry-picked based on the following PR:
Original PR description:
Issue
When participating in a call while in the foreground and then leaving that call, the app no longer receives and processes update events. When the app is brought to the background and then foreground, the problem is resolved.
This bug is a combination of a few issues that only first surfaced with #4477 which introduced new task cancellation checks in the sync.
The cause of the bug begins with code introduced in December last year (#4000) which solved a problem of the web socket closing during an ongoing call when bring the call to the background, by not suspending the sync during an ongoing call but only when all calls had finished. However, it suspended the sync at the end of calls regardless of whether the app was in the foreground or background. The sequence of events is thus:
This PR proposes a very small and simple fix which is intended to resolve the immediate problem of suspending the sync at the end of the call while in the foreground. The change is to only perform this suspension when the app is in the background, so that the websocket is closed correctly in the BG and not incorrectly while in the FG.
A more robust and general solution is needed to improve sync management and stability which will be addressed separately.
Testing
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: