Skip to content

Refactor the federation transmission code to delineate transaction preparation and completion. - #20166

Open
reivilibre wants to merge 2 commits into
developfrom
rei/sefb_piece1
Open

Refactor the federation transmission code to delineate transaction preparation and completion.#20166
reivilibre wants to merge 2 commits into
developfrom
rei/sefb_piece1

Conversation

@reivilibre

@reivilibre reivilibre commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

A key refactoring for, and split out of, #20165

Would be easier to land first to isolate the diff.

Should be a standalone change with no behavioural change.

Motivation is that #20165 will round-robin between 'main queue' transactions and 'sticky event' transactions.
To keep the data flow clear, I wanted to insert a typed struct (well, attrs dataclass) as an interface between the 'preparation' of a transaction and its 'completion'.
Doing this whilst keeping the asynchronous context manager style did not lead to a readable result in my opinion.
(I would also say the async context manager is a touch 'magic' / obscures control flow, but I suspect this is largely down to opinion.)

  1. Replace _TransactionQueueManager with prepare/complete transaction methods

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
@reivilibre
reivilibre marked this pull request as ready for review September 1, 2026 11:07
@reivilibre
reivilibre requested a review from a team as a code owner September 1, 2026 11:07
@reivilibre
reivilibre requested review from anoadragon453 and removed request for a team September 1, 2026 11:07
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.

1 participant