Skip to content

hotfix/cp-11566-push-delivery-issues-swp-twipe-report#349

Merged
snuricp merged 3 commits into
masterfrom
hotfix/cp-11566-push-delivery-issues-swp-twipe-report
May 18, 2026
Merged

hotfix/cp-11566-push-delivery-issues-swp-twipe-report#349
snuricp merged 3 commits into
masterfrom
hotfix/cp-11566-push-delivery-issues-swp-twipe-report

Conversation

@unnaticleverpush
Copy link
Copy Markdown
Contributor

@unnaticleverpush unnaticleverpush commented May 15, 2026

Improve FCM token sync reliability and stale token recovery


Note

Medium Risk
Changes FCM token persistence and sync conditions, which can affect subscription state and push delivery if the new comparison/persistence logic misbehaves. Risk is mitigated by keeping the old local token key and only adding a new synced-token marker.

Overview
Improves FCM token rotation/stale-token recovery by separating the latest locally seen token from the last successfully synced token.

SubscriptionManagerFCM.checkChangedPushToken now compares against SYNCED_FCM_TOKEN and triggers a resync when the token is forced, missing, or changed, updating both FCM_TOKEN and SYNCED_FCM_TOKEN only after a successful server sync (with clearer logging and failure reporting). CleverPushFcmListenerService.onNewToken now immediately caches the new token locally and, when a subscription exists, routes the update through getChannelConfigcheckChangedPushToken to ensure the server is brought in sync.

Reviewed by Cursor Bugbot for commit 64829a4. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Separates the local cached FCM token from the last successfully synced token to improve rotation handling and automatic recovery. Reduces push delivery failures reported in CP-11566 (SWP/Twipe).

  • Bug Fixes
    • In SubscriptionManagerFCM.checkChangedPushToken, compare against SYNCED_FCM_TOKEN (new) instead of local FCM_TOKEN; sync when forced/missing/changed; skip only if no token yet; on success update FCM_TOKEN and SYNCED_FCM_TOKEN; clearer logs and errors.
    • In CleverPushFcmListenerService.onNewToken, cache the latest token in FCM_TOKEN immediately (even without a subscription), then load config and call checkChangedPushToken for server sync.

Written for commit 64829a4. Summary will update on new commits.

Improve FCM token sync reliability and stale token recovery
@unnaticleverpush unnaticleverpush self-assigned this May 15, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bcaf97a. Configure here.

Comment thread cleverpush/src/main/java/com/cleverpush/manager/SubscriptionManagerFCM.java Outdated
Fixed FCM token retry logic by separating locally cached tokens from successfully synced server tokens.
@snuricp snuricp merged commit 21e179a into master May 18, 2026
4 of 6 checks passed
@snuricp snuricp deleted the hotfix/cp-11566-push-delivery-issues-swp-twipe-report branch May 18, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants