Be tolerant of the the end key not existing in a /messages response#489
Merged
MadLittleMods merged 1 commit intomainfrom Oct 4, 2022
Merged
Conversation
MadLittleMods
commented
Oct 4, 2022
Comment on lines
+1297
to
+1301
| // Since this will throw an error if they key does not exist, do this at the end of | ||
| // the loop. It's a valid scenario to be at the end of the room and have no more to | ||
| // paginate so we want to make sure the `return` above runs when we've found all of | ||
| // the expected events. | ||
| messageResEnd = client.GetJSONFieldStr(t, messsageResBody, "end") |
Collaborator
Author
There was a problem hiding this comment.
I am guessing this might be some Synapse change since I haven't noticed this before (nothing obvious in the changelog) 🤔
But it is part of the spec:
If no further events are available (either because we have reached the start of the timeline, or because the user does not have permission to see any more events), this property is omitted from the response.
-- https://spec.matrix.org/v1.1/client-server-api/#get_matrixclientv3roomsroomidmessages
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Be tolerant of the the
endkey not existing in a /messages response. As spec'd:Split out from #214
Previously, it would throw the following error and potentially we found all of the events within that last response to satisfy everything,