Skip to content

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

Open
MadLittleMods wants to merge 3 commits intodevelopfrom
madlittlemods/quarantined-media-wait-for-stream-token
Open

Replace wait_for_quarantined_media_stream_id(...) with standard wait_for_stream_token(...)#19764
MadLittleMods wants to merge 3 commits intodevelopfrom
madlittlemods/quarantined-media-wait-for-stream-token

Conversation

@MadLittleMods
Copy link
Copy Markdown
Contributor

@MadLittleMods MadLittleMods commented May 7, 2026

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)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant