Skip to content

fix(fcm): skip session update without token#6467

Merged
crossle merged 9 commits into
masterfrom
fix/refresh-fcm-token
Jun 26, 2026
Merged

fix(fcm): skip session update without token#6467
crossle merged 9 commits into
masterfrom
fix/refresh-fcm-token

Conversation

@SeniorZhai

@SeniorZhai SeniorZhai commented Jun 24, 2026

Copy link
Copy Markdown
Member

No description provided.

@SeniorZhai SeniorZhai added the testing Now testing, but you can review label Jun 24, 2026
@SeniorZhai SeniorZhai force-pushed the fix/refresh-fcm-token branch from b2df340 to 42fb377 Compare June 24, 2026 14:16
@SeniorZhai SeniorZhai changed the title fix(fcm): refresh notification token fix(fcm): skip session update without token Jun 24, 2026
@SeniorZhai SeniorZhai force-pushed the fix/refresh-fcm-token branch from 42fb377 to 90601b8 Compare June 24, 2026 14:19
@SeniorZhai SeniorZhai force-pushed the fix/refresh-fcm-token branch from 90601b8 to 0577a7d Compare June 24, 2026 14:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SessionWorker to use await() 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-services dependency 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.

Comment thread app/src/main/java/one/mixin/android/worker/SessionWorker.kt Outdated
Comment thread app/src/main/java/one/mixin/android/worker/SessionWorker.kt Outdated
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.
@SeniorZhai SeniorZhai force-pushed the fix/refresh-fcm-token branch from 7bf1c38 to 0cdd859 Compare June 25, 2026 06:21
@SeniorZhai SeniorZhai force-pushed the fix/refresh-fcm-token branch from 218dca2 to 3aada18 Compare June 25, 2026 10:25
@SeniorZhai SeniorZhai force-pushed the fix/refresh-fcm-token branch from 3aada18 to 5cef7d0 Compare June 26, 2026 04:11
@crossle crossle merged commit 76429a4 into master Jun 26, 2026
1 check passed
@crossle crossle deleted the fix/refresh-fcm-token branch June 26, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Now testing, but you can review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants