Skip to content

MSC4140: drop delayed state interference#19495

Open
AndrewFerr wants to merge 3 commits intoelement-hq:developfrom
AndrewFerr:msc4140-drop-state-cancel-rule
Open

MSC4140: drop delayed state interference#19495
AndrewFerr wants to merge 3 commits intoelement-hq:developfrom
AndrewFerr:msc4140-drop-state-cancel-rule

Conversation

@AndrewFerr
Copy link
Member

No longer cancel a user's delayed state events by a more recent state event sent from a different user. This behaviour has been delegated to an "alternative" in the delayed event MSC for some time now, and is not known to be used by any module other than experimental iterations of MatrixRTC.

See also: matrix-org/complement#845

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

No longer cancel a user's delayed state events by a more recent state
event sent from a different user.  This behaviour has been delegated to
an "alternative" in the delayed event MSC for some time now, and is not
known to be used by any module other than experimental iterations of
MatrixRTC.
@AndrewFerr AndrewFerr requested a review from a team as a code owner February 24, 2026 03:41
@reivilibre reivilibre self-requested a review March 3, 2026 13:32
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, just need to go through the slightly tedious motions for the schema version, I think

CREATE INDEX delayed_events_is_processed ON delayed_events (is_processed);
CREATE INDEX delayed_events_room_state_event_idx ON delayed_events (room_id, event_type, state_key) WHERE state_key IS NOT NULL;

-- TODO: delete this table in the next Synapse release that can handle a breaking DB change
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is possibly better tracked as a GitHub issue instead of a comment here.

More concretely, we need to study https://element-hq.github.io/synapse/latest/development/database_schema.html#synapse-schema-versions

There's a worked example with a table removal. Since I think it's fine to have degraded rollback support for this experimental feature (as in, I think it's probably OK to stop reading and writing to this table at the same time), I think for us this is something along the lines of:

  • SCHEMA_VERSION needs to be increased now, with a comment on the version saying that in the new SCHEMA_VERSION we no longer use this table.

  • In a later version, we can make SCHEMA_COMPAT_VERSION match that as we drop the table, preventing rollback to the older SCHEMA_VERSION.


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • SCHEMA_VERSION needs to be increased now, with a comment on the version saying that in the new SCHEMA_VERSION we no longer use this table.

Since the schema isn't actually changed by this PR, would it be acceptable to put that comment on the latest SCHEMA_VERSION (which is a newer version than when the table was created) instead of creating an "empty" bump?

Co-authored-by: Olivier 'reivilibre' <olivier@librepush.net>
MadLittleMods pushed a commit to matrix-org/complement that referenced this pull request Mar 4, 2026
Don't test that a user's delayed state events are cancelled by a more recent
state event from a different user.  That behaviour [has been delegated to
an "alternative"]
(matrix-org/matrix-spec-proposals@3efecea)
in the delayed event MSC4140 for some time now, and may be removed from
Synapse ([Synapse PR](element-hq/synapse#19495))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants