Skip to content

errors: Document error code 61002 - #356

Merged
lmars merged 1 commit into
mainfrom
error-61002
Jul 30, 2026
Merged

errors: Document error code 61002#356
lmars merged 1 commit into
mainfrom
error-61002

Conversation

@lmars

@lmars lmars commented Jul 30, 2026

Copy link
Copy Markdown
Member

Adds the registry entry for 61002, the push activation failure raised when a device already holds a registration belonging to a different clientId. 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.json is regenerated via npm 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:

SDK Location Message Status
ably-java push/ActivationStateMachine.java:708 (validateRegistration()) Activation failed: present clientId is not compatible with existing device registration 400
ably-cocoa ARTPushActivationState.m:95 (validateAndSync()) same not set
ably-dotnet Push/ActivationStateMachine.cs:226 same 400
ably-js plugins/push/pushactivation.ts:682 clientId not compatible with local device clientId 400

Specifically:

  • The comparison is the clientId held in local device state against the clientId the client is presently authenticated as.
  • The registration is left untouched: the SyncRegistrationFailed event is emitted before the PUT / SaveAsync, so the device keeps receiving notifications addressed to the original clientId.
  • The failure is permanent, so the documented remediation is deactivate then activate. AfterRegistrationSyncFailed + CalledDeactivate deregisters, and Deregistered calls LocalDevice.reset(), which clears the stored clientId (ably-java LocalDevice.java:139-148).
  • Delivery depends on what triggered the check, which is why What you'll see covers both paths: Android sends PUSH_ACTIVATE when activation triggered it and PUSH_UPDATE_FAILED otherwise (ActivationStateMachine.java:557-567); ably-cocoa branches between callActivatedCallback: and callUpdatedCallback: the same way.

Both outbound links resolve (checked against the page sources in ably/docs and 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:

  • The device clientId is never persisted (re-read from auth.clientId on every load, pushactivation.ts:163), so ably-js cannot detect the cross-session case of a different user signing in; it only catches a clientId change since the device was loaded.
  • The event is emitted from NotActivated, which does not handle SyncRegistrationFailed, so it is enqueued rather than dispatched and the activate() callback may never fire. NotActivated + CalledDeactivate also 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 against ably/docs bumps the ably-common submodule and commits the regenerated pages.

🤖 Generated with Claude Code

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>
@lmars
lmars requested a review from ttypic July 30, 2026 08:57

@ttypic ttypic 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.

LGTM

@lmars
lmars merged commit 327bf74 into main Jul 30, 2026
2 checks passed
@lmars
lmars deleted the error-61002 branch July 30, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants