Skip to content

Conversation

H-Shay
Copy link
Contributor

@H-Shay H-Shay commented Sep 23, 2025

Adds an endpoint to allow server admins to fetch an event regardless of their membership in the originating room.

@H-Shay H-Shay requested a review from a team as a code owner September 23, 2025 19:13
@github-actions github-actions bot deployed to PR Documentation Preview September 23, 2025 19:14 Active
@github-actions github-actions bot deployed to PR Documentation Preview September 23, 2025 19:18 Active
@github-actions github-actions bot deployed to PR Documentation Preview September 23, 2025 19:26 Active
@github-actions github-actions bot deployed to PR Documentation Preview September 23, 2025 19:38 Active
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor points, looks fine overall though :)

Response:
```json
{
"event_id": "$hbFTSxFNaPau73B8fqGTFrkSqxOpaFjlnzOFEPw9tMA",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this to match some other response format, or is it just redundant? (You already needed to know the event ID to query this API, also I think it may even feature within the event itself)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to matching anything, the event id wasn't being returned as part of the event so I changed the serialization of the event to include it and removed from the top of the response.

await assert_requester_is_admin(self._auth, request)

event = await self._store.get_event(
event_id, EventRedactBehaviour.as_is, allow_none=True, allow_rejected=True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to clearly document that we will return rejected events here? (I can see people benefitting from this being said, as well as maybe how you know from the response)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably helpful, and just to double-check - if an event is rejected there should be a rejection_reason in the unsigned field of the event, correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not seeing anywhere that would be added. Have you seen this in practice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't, and looking I actually don't see it added - my only thought was that if it ended up in internal_metadata it could be copied over at some point. Given that doesn't seem to be the case, I am unsure how you would tell if the event was rejected. My hope was to give admins as much information as possible, hence including the rejected events, but if admins have no way of telling if the event was rejected I am unsure of the utility of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reivilibre I've changed the search to not return rejected events - I wasn't sure how to indicate that the events had been rejected, and the utility of returning them is quite low to begin with.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wanted it, I think the answer would probably be to include "rejected": false at the top-level (as a sibling of event) — I can't spot it being transferred over in any other way (I think only specific bits and pieces of internal_metadata are copied over, didn't see the rejection status though).

I don't mind either way, I'm not really sure whether people would find it useful or not.

@github-actions github-actions bot deployed to PR Documentation Preview September 29, 2025 21:02 Active
@H-Shay H-Shay requested a review from reivilibre September 29, 2025 21:06
@H-Shay
Copy link
Contributor Author

H-Shay commented Sep 29, 2025

pretty sure test failures are flakes, but I can't kick the ci to be sure

await assert_requester_is_admin(self._auth, request)

event = await self._store.get_event(
event_id, EventRedactBehaviour.as_is, allow_none=True, allow_rejected=True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not seeing anywhere that would be added. Have you seen this in practice?

@H-Shay H-Shay requested a review from reivilibre October 6, 2025 18:58
@github-actions github-actions bot deployed to PR Documentation Preview October 6, 2025 18:59 Active
@reivilibre reivilibre enabled auto-merge (squash) October 7, 2025 18:43
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.

2 participants