Skip to content

Error codes 40163/40164 are indistinguishable; 40160 should list deliberate access removal as a cause #360

Description

@mattheworiordan

Two content problems in the error-code registry, found while writing new docs on removing a user's channel access (token capabilities + revocation). Both fixes belong in this repo: the pages at ably.com/docs/platform/errors/codes/* are generated from errors/codes/*.md here, and hand-edits to the generated pages fail the website's docs-check-error-docs CI job.

1. 40163 and 40164 are indistinguishable

errors/codes/40163.md and errors/codes/40164.md produce identical titles and word-for-word identical descriptions:

40163 / 40164: Token revocation not enabled for API key
The operation was refused because the API key used does not have revocable tokens enabled. Revocation applies only to tokens issued by a key with that setting turned on.

A developer who hits one of these cannot learn from the docs why their case produced 40163 rather than 40164, and the two generated pages (40163, 40164) are near-duplicates of each other.

Ask: either document what actually distinguishes them (which operation or code path raises each), or, if one is vestigial, say so on its page and point at the canonical one.

2. 40160 does not mention deliberate access removal

40160 (operation not permitted with provided capability) is what a client sees when its access to a channel is deliberately removed: the server narrows the capability its token endpoint issues, then revokes the user's tokens; the channel force-detaches into the failed state with 40160 and further attach attempts are refused, while the connection and the client's other channels are unaffected.

A new guide documenting that flow is about to land on the website (/docs/auth/ban-users, branch docs/auth-ban-users-guide in ably/website). The 40160 page would answer the "why am I seeing this?" question better if it listed this cause. Proposed addition to errors/codes/40160.md, appended to the existing "Why it happens" list (registry sources use absolute links):

- A deliberate removal of access, such as banning a user from a channel. Revoking the user's tokens
  after narrowing what your token endpoint grants them detaches that channel into the `failed` state
  with this error and refuses further attach attempts, while the user's other channels stay attached.
  See [ban users](https://ably.com/docs/auth/ban-users).

Sequencing: Note item 2 depends on whether /docs/auth/ban-users lands, which right now is not even a PR.

Simon / Lewis assigned you as I know you have both done work on error codes, but not sure who's best to look at this

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions