Files
synapse/changelog.d
Paul Chobert fa9dbbd3ec Stabilize the M_UNKNOWN_DEVICE error code (#20181)
Part of: #19415

TLDR: return the `M_UNKNOWN_DEVICE` error code instead of the unstable
`ORG.MATRIX.MSC4326.M_UNKNOWN_DEVICE` identifier.

> **[Added in `v1.17`]** Application services MAY similarly masquerade
as a specific device ID belonging the user ID through use of the
`device_id` query string parameter on the request. If the given device
ID is not known to belong to the user, the server will return a 400
`M_UNKNOWN_DEVICE` error.
>
> — [Matrix v1.19, Application Service API — Identity
assertion](https://spec.matrix.org/v1.19/application-service-api/#identity-assertion)

Synapse returns the correct 400, but with the unstable identifier.
MSC4326 was stabilized in Matrix 1.17 and its experimental flag was
already removed in #19033; only the error code identifier was left
behind.

Before:

```
GET /_matrix/client/v3/sync?user_id=@alice:test&device_id=NOT_A_REAL_DEVICE_ID  # appservice token
  400 {"errcode": "ORG.MATRIX.MSC4326.M_UNKNOWN_DEVICE"}
```

After:

```
GET /_matrix/client/v3/sync?user_id=@alice:test&device_id=NOT_A_REAL_DEVICE_ID  # appservice token
  400 {"errcode": "M_UNKNOWN_DEVICE"}
```

I verified that no implementation was currently handling the prefixed
error code.
2026-09-11 07:59:15 -05:00
..