errors: Document error code 61002 - #356
Merged
Merged
Conversation
Add the registry entry for 61002, the push activation failure raised when a device already holds a registration belonging to a different clientId, and regenerate protocol/errors.json. Verified against the raising code in ably-java, ably-cocoa, ably-dotnet and ably-js. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Adds the registry entry for
61002, the push activation failure raised when a device already holds a registration belonging to a differentclientId. The code was in use in the SDKs but had no entry in the registry, so it rendered without a title or summary on the docs site.protocol/errors.jsonis regenerated vianpm run generate:errors.Verified against the raising code
Every claim in the body was checked against the four SDKs that raise the code, all of which emit it before any registration write:
push/ActivationStateMachine.java:708(validateRegistration())Activation failed: present clientId is not compatible with existing device registrationARTPushActivationState.m:95(validateAndSync())Push/ActivationStateMachine.cs:226plugins/push/pushactivation.ts:682clientId not compatible with local device clientIdSpecifically:
clientIdheld in local device state against theclientIdthe client is presently authenticated as.SyncRegistrationFailedevent is emitted before thePUT/SaveAsync, so the device keeps receiving notifications addressed to the originalclientId.AfterRegistrationSyncFailed+CalledDeactivatederegisters, andDeregisteredcallsLocalDevice.reset(), which clears the storedclientId(ably-javaLocalDevice.java:139-148).PUSH_ACTIVATEwhen activation triggered it andPUSH_UPDATE_FAILEDotherwise (ActivationStateMachine.java:557-567); ably-cocoa branches betweencallActivatedCallback:andcallUpdatedCallback:the same way.Both outbound links resolve (checked against the page sources in
ably/docsand with a request to the live site).Follow-up, out of scope here
Two ably-js quirks noticed while verifying, neither affecting the copy but both possibly worth an issue on
ably/ably-js:clientIdis never persisted (re-read fromauth.clientIdon every load,pushactivation.ts:163), so ably-js cannot detect the cross-session case of a different user signing in; it only catches aclientIdchange since the device was loaded.NotActivated, which does not handleSyncRegistrationFailed, so it is enqueued rather than dispatched and theactivate()callback may never fire.NotActivated+CalledDeactivatealso does not deregister (pushactivation.ts:673), unlike ably-cocoa's RSH3a1c check.Publishing
Per
errors/CLAUDE.md, this is not live on the docs site until a follow-up PR againstably/docsbumps theably-commonsubmodule and commits the regenerated pages.🤖 Generated with Claude Code