Bugfix/noid/ensure successful requests after leaving chat#6333
Open
mahibi wants to merge 3 commits into
Open
Conversation
Move the WebSocket "leave room" signal to the start of leaveRoom() so the HPB stops considering the user "in" the room before the backend DELETE is even sent. This closes the window in which the HPB could trigger the server to delete a freshly-created notification. AI-assistant: Claude Code v2.1.142 (Claude Sonnet 4.6) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Replace the RxJava leaveRoom HTTP call with a coroutine launched on an application-scoped CoroutineScope, so the request survives onPause and ViewModel teardown and completes even after back-navigation. AI-assistant: Claude Code v2.1.142 (Claude Sonnet 4.6) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Move sessionIdAfterRoomJoined reset to right after the WebSocket send in ChatActivity.leaveRoom() - the session ID is already consumed at that point so there's no reason to wait for the HTTP response. Remove the leaveRoomViewState observer from ChatActivity since it's no longer responsible for anything useful. The callback now fires directly from the coroutine via withContext(Main), which avoids the LiveData lifecycle gate that could silently drop it when the Activity is already stopping. AI-assistant: Claude Code v2.1.142 (Claude Sonnet 4.6) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Collaborator
Author
|
For followup PRs:
|
Contributor
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/27347136603/artifacts/7569076256 |
Collaborator
Author
|
not backporting to 24.0. I want this to be tested a bit longer, so for 24.1 |
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.
Fix race conditions while leaving a chat room.
This might have been one reason why servers to deleted a freshly-posted notification because it might have considered to be a user still being in a room. See commit messages for further details.
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)