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.
Update
get_pdu
to return the original, pristineEventBase
#13320Update
get_pdu
to return the original, pristineEventBase
#13320Changes from 7 commits
ee236ca
79a1b72
bfd35fd
e0e20a5
22410f2
09c411b
6029b42
09167b1
eb6a291
1c4e57c
488f5ed
29a5269
2688e44
24913e7
0e6dd5a
5bc75ed
dea7669
72e65a5
86fe0dc
fd879bb
354678f
233077c
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.
I like the idea of having it be immutable 👍
But needing to pass in
outlier
or the metadata (when we need to add more than justoutlier
in the future) makes the function signature surface a bit icky. I'd rather just force downstream consumers to create a copy with the metadata they need/expect, or want to add.We can tackle this in another potential PR though.
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.
yes, there's definitely a balance of two evils here. I'm happy to punt this for now at least.
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.
if we're going to build a new EventBase on each call, why not just cache the raw json?
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 would work. But we would have to convert the
EventBase
back to JSON fromget_pdu_from_destination_raw
since it needs one for_check_sigs_and_hash(room_version, pdu)
anyway (whether that be inget_pdu_from_destination_raw
or inget_pdu
). I'm inclined to leave it as-is. Feel free to push againThere 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.
wait... does this loop always try all the destinations, even if the first one works? that would be a substantial bug, if it was ever called with more than one destination, which I don't think it is...
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.
Seems like it is bugged. I can add a
break
or refactor to do thereturn
inside thefor-loop
in a separate PR after this merges ⏩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've added a
FIXME
comment in the code for now so we don't forget or at least will know to tackle it at some point. I plan to tackle in a fast-follow-up after this PR since it's a separate bug. Feel free to push to include it here.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.
Followed up in #13346