fix(push): use onNewRegistrationToken instead of activate() on FCM token refresh#3282
fix(push): use onNewRegistrationToken instead of activate() on FCM token refresh#3282
Conversation
…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>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment 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 |
Summary
push.activate()inonNewTokenwithpush.getActivationContext().onNewRegistrationToken(RegistrationToken.Type.FCM, token)activate()triggers a full device registration flow (CalledActivatestate machine event), which is wrong for a token refreshonNewRegistrationTokenfiresGotPushDeviceDetails— updating the stored token and re-registering with Ably only if the device is already activatedimport io.ably.lib.types.RegistrationToken🤖 Generated with Claude Code