Sync: $ME and $LAZY in required_state are not resolved #1661

Open
opened 2026-04-14 19:46:11 +00:00 by kiorul · 1 comment

As described in MSC3575, *, $ME and $LAZY in required_state are special sentinel values that Continuwuity must resolve. However, $ME and $LAZY are currently not handled in collect_required_state in src/api/client/sync/v5.rs. Only * is considered there.

Some clients, especially those relying on the official Matrix Rust SDK, expect these values to be resolved. For example, Element X (iOS and Android), which uses it, fails to load the push rules because $ME is not handled correctly by Continuwuity. This leads to a fallback to silent notifications. This is documented in several places:

I’ve explained the mechanism in #1533 (comment).

Currently, I am not aware of any bugs resulting from the missing handling of $LAZY, but there may be some.

If I understand correctly, MSC3575 is deprecated in favor of MSC4186, where $ME and $LAZY are no longer present (see also this comment). However, the Rust SDK still seems to rely on them (see here) and Synapse uses them too (see this file, where $ME is StateValues.ME and $LAZY is StateValues.LAZY). I am not very familiar with the Matrix specification or its development process, so this is somewhat confusing to me.

At the moment, however, they still seem to be required, since implementing support for $ME has been confirmed to fix the silent notification bug with Element X.

As described in [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/blob/kegan/sync-v3/proposals/3575-sync.md#room-list-parameters), `*`, `$ME` and `$LAZY` in `required_state` are special sentinel values that Continuwuity must resolve. However, `$ME` and `$LAZY` are currently not handled in [`collect_required_state`](https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/eccdb285b8d2b85543095d870c39ec9959201b6c/src/api/client/sync/v5.rs#L684) in `src/api/client/sync/v5.rs`. Only `*` is considered there. Some clients, especially those relying on the official [Matrix Rust SDK](https://github.com/matrix-org/matrix-rust-sdk/), expect these values to be resolved. For example, Element X (iOS and Android), which uses it, fails to load the push rules because `$ME` is not handled correctly by Continuwuity. This leads to a fallback to silent notifications. This is documented in several places: - #1533 - #1424 - https://github.com/element-hq/element-x-ios/issues/5132 I’ve explained the mechanism in https://forgejo.ellis.link/continuwuation/continuwuity/issues/1533#issuecomment-27062. Currently, I am not aware of any bugs resulting from the missing handling of `$LAZY`, but there may be some. If I understand correctly, MSC3575 is deprecated in favor of [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md), where `$ME` and `$LAZY` are no longer present (see also [this](https://github.com/matrix-org/matrix-spec-proposals/pull/4186#discussion_r2421736069) comment). However, the Rust SDK still seems to rely on them (see [here](https://github.com/matrix-org/matrix-rust-sdk/blob/9d39e4bae8003a349825f15f87123bb8a8096f2e/crates/matrix-sdk-ui/src/notification_client.rs#L499)) and Synapse uses them too (see this [file](https://github.com/element-hq/synapse/blob/bed00bb7669d2768a7e13715bc89b5c34670225f/synapse/handlers/sliding_sync/__init__.py), where `$ME` is `StateValues.ME` and `$LAZY` is `StateValues.LAZY`). I am not very familiar with the Matrix specification or its development process, so this is somewhat confusing to me. At the moment, however, they still seem to be required, since implementing support for `$ME` has been [confirmed](https://github.com/element-hq/element-x-ios/issues/5132#issuecomment-4230001081) to fix the silent notification bug with Element X.

nice, hope it would get fixed soon 👍

nice, hope it would get fixed soon 👍
kiorul changed title from Sync v5: $ME and $LAZY in required_state are not resolved to Sync: $ME and $LAZY in required_state are not resolved 2026-04-15 13:35:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#1661
No description provided.