fix(fcm): skip session update without token#6467
Merged
Merged
Conversation
b2df340 to
42fb377
Compare
42fb377 to
90601b8
Compare
90601b8 to
0577a7d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Firebase Cloud Messaging (FCM) token handling during session updates by preventing session updates when a usable token can’t be obtained, and adds a debug UI action to manually trigger an FCM token/session update.
Changes:
- Update
SessionWorkerto useawait()for FCM token retrieval, gate behavior on Google Play services availability, and avoid proceeding with missing/blank tokens. - Add a “Update FCM Token” action to the Log & Debug screen that triggers a session update using the current FCM token and surfaces success/failure to the user.
- Add
kotlinx-coroutines-play-servicesdependency and related localized strings.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Adds new strings for the debug “Update FCM Token” action and success toast. |
| app/src/main/res/values-zh-rTW/strings.xml | Adds Traditional Chinese (Taiwan) translations for the new debug strings. |
| app/src/main/res/values-zh-rCN/strings.xml | Adds Simplified Chinese translations for the new debug strings. |
| app/src/main/res/layout/fragment_log_debug.xml | Adds a new row/button in the Log & Debug screen for updating the FCM token. |
| app/src/main/java/one/mixin/android/worker/SessionWorker.kt | Changes session update flow to retrieve FCM token via coroutines and skip/retry behavior around token availability. |
| app/src/main/java/one/mixin/android/ui/setting/LogAndDebugViewModel.kt | Adds a debug-only API to fetch the FCM token and call updateSession. |
| app/src/main/java/one/mixin/android/ui/setting/LogAndDebugFragment.kt | Wires the new UI action to call the ViewModel and show progress + result dialogs/toasts. |
| app/build.gradle.kts | Adds kotlinx-coroutines-play-services to support Task.await(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reset Firebase Installations on FIS_AUTH_ERROR before retrying token retrieval. Avoid reading Firebase installation id results before the task completes when building device ids.
7bf1c38 to
0cdd859
Compare
218dca2 to
3aada18
Compare
3aada18 to
5cef7d0
Compare
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.
No description provided.