Skip to content

fix(push): use onNewRegistrationToken instead of activate() on FCM token refresh#3282

Open
maratal wants to merge 1 commit intomainfrom
dx-973-Push-activate-a-noop
Open

fix(push): use onNewRegistrationToken instead of activate() on FCM token refresh#3282
maratal wants to merge 1 commit intomainfrom
dx-973-Push-activate-a-noop

Conversation

@maratal
Copy link
Collaborator

@maratal maratal commented Mar 18, 2026

Summary

  • Replaces push.activate() in onNewToken with push.getActivationContext().onNewRegistrationToken(RegistrationToken.Type.FCM, token)
  • activate() triggers a full device registration flow (CalledActivate state machine event), which is wrong for a token refresh
  • onNewRegistrationToken fires GotPushDeviceDetails — updating the stored token and re-registering with Ably only if the device is already activated
  • Adds missing import io.ably.lib.types.RegistrationToken

🤖 Generated with Claude Code

…ken refresh

Calling activate() in onNewToken triggers a full device registration flow
(CalledActivate state machine event). The correct approach is onNewRegistrationToken,
which fires GotPushDeviceDetails — updating the stored token and re-registering
with Ably only if the device is already activated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 023d4f98-8004-4d8d-bca1-8a77268b24e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dx-973-Push-activate-a-noop
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

2 participants