Skip to content

Replace wait_for_quarantined_media_stream_id(...) with standard wait_for_stream_token(...)#19764

Merged
MadLittleMods merged 6 commits into
developfrom
madlittlemods/quarantined-media-wait-for-stream-token
May 15, 2026
Merged

Replace wait_for_quarantined_media_stream_id(...) with standard wait_for_stream_token(...)#19764
MadLittleMods merged 6 commits into
developfrom
madlittlemods/quarantined-media-wait-for-stream-token

Conversation

@MadLittleMods

@MadLittleMods MadLittleMods commented May 7, 2026

Copy link
Copy Markdown
Contributor

Replace wait_for_quarantined_media_stream_id(...) with standard wait_for_stream_token(...).

In order to be able to use wait_for_stream_token(...), we have to add the quarantined_media stream to the StreamToken. Even though we don't care about /sync'ing quarantined_media, this aligns with the future where all endpoints should probably use StreamToken, see #19647

Follow-up to #19558 and #19644

Dev notes

SYNAPSE_TEST_LOG_LEVEL=INFO poetry run trial tests.rest.admin.test_media.ListQuarantinedMediaChangesTestCase

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)

@MadLittleMods MadLittleMods added A-Admin-API A-Media-Repository A-Abuse Reports, media quarantine, policy servers, etc labels May 7, 2026
Comment on lines -1324 to -1326
See https://github.com/element-hq/synapse/pull/19644 for more details.

TODO: Replace function and call sites with https://github.com/element-hq/synapse/pull/19644

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing wait_for_quarantined_media_stream_id(...) as planned ^

Comment on lines -259 to -260
# resources on that which is why `wait_for_quarantined_media_stream_id(...)`
# has assertions around this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the last part of this comment as wait_for_stream_token(...) no longer has these assertions (#19644 used to have it but was removed per #19644 (comment))

Comment thread synapse/streams/events.py
)
thread_subscriptions_key = self.store.get_max_thread_subscriptions_stream_id()
sticky_events_key = self.store.get_max_sticky_events_stream_id()
quarantined_media_key = self.store.get_quarantined_media_stream_token()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The rest of this is just boilerplate to add quarantined_media to the StreamToken

@MadLittleMods MadLittleMods marked this pull request as ready for review May 8, 2026 01:20
@MadLittleMods MadLittleMods requested a review from a team as a code owner May 8, 2026 01:20
Comment thread changelog.d/19764.misc Outdated
MadLittleMods and others added 3 commits May 15, 2026 11:40
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
…of github.com:element-hq/synapse into madlittlemods/quarantined-media-wait-for-stream-token
@MadLittleMods MadLittleMods merged commit 8eb220a into develop May 15, 2026
79 of 81 checks passed
@MadLittleMods MadLittleMods deleted the madlittlemods/quarantined-media-wait-for-stream-token branch May 15, 2026 18:51
@MadLittleMods

Copy link
Copy Markdown
Contributor Author

Thanks for the review @anoadragon453 🐙

FrenchGithubUser pushed a commit to famedly/synapse-upstreaming that referenced this pull request Jun 12, 2026
…it_for_stream_token(...)` (element-hq#19764)

In order to be able to use `wait_for_stream_token(...)`, we have to add
the `quarantined_media` stream to the `StreamToken`. Even though we
don't care about `/sync`'ing `quarantined_media`, this aligns with the
future where all endpoints should probably use `StreamToken`, see
element-hq#19647

Follow-up to element-hq#19558 and
element-hq#19644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Abuse Reports, media quarantine, policy servers, etc A-Admin-API A-Media-Repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants