This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement MSC2175 to stop adding the creator field. #15394
Implement MSC2175 to stop adding the creator field. #15394
Changes from 7 commits
04ce3e3
f5c325b
fd8f45a
811df39
48ef4f9
06b6fd8
a353870
c66df21
b18ab18
b682443
96598a5
9403987
22a71da
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the existing logic correct? Shouldn't it be
if not room_version.msc2716_historical OR (...)
?(
A => B
iffnot A or B
.)Additionally: I think (strictly speaking) that this makes MSC2716 depend on MSC2175?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, would need to ask @MadLittleMods.
Yes, I guess this should probably use the same or logic that we use in other spots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I fixed this to break the dependency. 🤷 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic correct. This is taking a lot of squinting so it could probably be clearer but here is the breakdown:
If we used
OR
here, then the second case with existing room versions would never be work.synapse/synapse/handlers/federation_event.py
Lines 1522 to 1524 in b682443
If we break these down into conditions, then the current boolean logic looks like:
not V and (not E or not C)
If we add some labels and derive a positive
should_process_event
condition which we can then later negate, then the boolean logic looks likenot (V or (E and C))
which simplifies to the exact same logic above (see alternate form listed on Wolfram Alpha)This probably does make more sense though (if we find it clearer, feel free to update the 3 spots where we do this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, thanks for double checking. (I'd missed that this logic was guarding an early return, amongst other things.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside: Is the
rooms.creator
column useful? I guess it avoids looking up the create event and from the state and event_json tables (though I'd bet we're already looking in those tables anyway).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly certain that we do use it, but it seems like it has been around forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe not -- it was added in #10697.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be mentioned on #10737 too.