-
-
Notifications
You must be signed in to change notification settings - Fork 145
fix(client-server): Fix a typo in /rooms/{roomId}/relations/{eventId}
#2357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Hywan
wants to merge
4
commits into
matrix-org:main
Choose a base branch
from
Hywan:fix-client-server-relations-sync-token
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Clarify which tokens can be used in `from` or `to` in `GET /rooms/{roomId}/relations/{eventId}`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Starting a proper thread for this discussion.
Pagination tokens are positions between events. You should be able to further paginate from any position.
While this information is coming from my Synapse knowledge, I don't think that idea is Synapse specific.
You can see the sort of Complement tests I added around this kind of thing for
/timestamp_to_eventwhere you can paginate backwards from thestartorendtokens,Uh oh!
There was an error while loading. Please reload this page.
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.
Any suggestion of how it should be phrased then?
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.
Why would you want to paginate backwards from an
endtoken?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 boils down to "because you can" and client flexibility. They may not want to process the event from
/contextand instead are only using it to get a pagination token to use as part of their normal pagination flows (uniform handling).A more technical reason is perhaps you're using the
filterquery parameter: with/context, "It is not applied to theeventitself" but it will apply consistently with/messages.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.
Honestly "because Synapse lets me get away with it" doesn't hold much water for me here. We need to be mindful of meeting the requirements of a client without unduly constraining server implementations. Further, since we are talking about changing the definition of an existing, specified endpoint, there is a fine line between "correcting an obvious error" and "changing the way the endpoint works". It is not fair to other server implementations to suddenly add requirements without following the MSC process.
Nevertheless, an analogy with
/messagesis somewhat compelling. The spec for that has no restriction against paginating backwards from anext_batchin/sync, so we should probably replicate that. (Though it does appear to preclude paginating in either direction from the results of/contextor/search, which I don't think is deliberate.)(Also, why would we only permit paginating backwards from the
startof a/messagesrather than anend?)So I guess we should loosen these constraints.
(And remove the separate description for
dir=f)I'm hoping for insight from the rest of the SCT on this, because frankly I'm struggling to decide.
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.
We discussed this among the SCT, and ended up concluding that the whole pagination thing needed simplifying and making more consistent, but that would require an MSC since it will mean changing behaviour for some implementations... which @clokep has offered to write! 🎉
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 have written one, waiting for a bit of feedback on the draft from @richvdh and then will publish. Hopefully this week.
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.
See MSC4492.