synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Fix a bug where redactions were not being sent over federation if we did not have the original event.

Open H-Shay opened this issue 3 years ago • 2 comments

Prior to this change, redactions were not sent over federation if the sending server hadn't received the original event. Fixes #12795. Per the discussion on #12795, this is achieved by making the function EventsWorkerStore._get_events_from_cache_or_db public and using that rather than EventsWorkerStore.get_events_as_list, which drops redaction events if the original event isn't present. I wrote a test to verify that this change works, you can see it here: https://github.com/matrix-org/complement/actions/runs/3055371487/jobs/4929450057

H-Shay avatar Sep 14 '22 17:09 H-Shay

Complement test is https://github.com/matrix-org/complement/pull/462

DMRobertson avatar Sep 15 '22 12:09 DMRobertson

We now have get_events_from_cache_or_db and get_events_as_list which both sound like they do the same thing but have different behaviour with regard to redaction events.

I don't disagree, and it's basically the point I made on #12795:

having lots of similar-but-different entry points makes a component hard to use correctly.

Still, I can't think of a better solution here. What we could do is try to find names that better describe the functionality (maybe s/get_events_from_cache_or_db/get_unredacted_events? other suggestions welcome) and spell out the differences between the entry points in the docstrings.

richvdh avatar Sep 22 '22 12:09 richvdh

Merged #13813 into develop, thanks for the explanations and the review!

H-Shay avatar Oct 11 '22 18:10 H-Shay