-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Move MSC3030 /timestamp_to_event endpoint to stable v1 location
#14471
Changes from all commits
0312ad3
80a2b96
ee00b8d
d73088f
ed1180a
e702a5d
394d917
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Move MSC3030 `/timestamp_to_event` endpoints to stable `v1` location (`/_matrix/client/v1/rooms/<roomID>/timestamp_to_event?ts=<timestamp>&dir=<direction>`, `/_matrix/federation/v1/timestamp_to_event/<roomID>?ts=<timestamp>&dir=<direction>`). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1691,9 +1691,19 @@ async def _timestamp_to_event_from_destination( | |
| # to return events on *both* sides of the timestamp to | ||
| # help reconcile the gap faster. | ||
| _timestamp_to_event_from_destination, | ||
| # Since this endpoint is new, we should try other servers before giving up. | ||
| # We can safely remove this in a year (remove after 2023-11-16). | ||
| failover_on_unknown_endpoint=True, | ||
|
Comment on lines
+1694
to
+1696
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we file an issue for this and add it to the Revisit: Next Year milestone? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW in the past I've just never removed the failover logic for new endpoints. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -> #14577 |
||
| ) | ||
| return timestamp_to_event_response | ||
| except SynapseError: | ||
| except SynapseError as e: | ||
| logger.warn( | ||
| "timestamp_to_event(room_id=%s, timestamp=%s, direction=%s): encountered error when trying to fetch from destinations: %s", | ||
| room_id, | ||
| timestamp, | ||
| direction, | ||
| e, | ||
| ) | ||
| return None | ||
|
|
||
| async def _timestamp_to_event_from_destination( | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -1284,17 +1284,14 @@ class TimestampLookupRestServlet(RestServlet): | |||
| `dir` can be `f` or `b` to indicate forwards and backwards in time from the | ||||
| given timestamp. | ||||
|
|
||||
| GET /_matrix/client/unstable/org.matrix.msc3030/rooms/<roomID>/timestamp_to_event?ts=<timestamp>&dir=<direction> | ||||
| GET /_matrix/client/v1/rooms/<roomID>/timestamp_to_event?ts=<timestamp>&dir=<direction> | ||||
| { | ||||
| "event_id": ... | ||||
| } | ||||
| """ | ||||
|
|
||||
| PATTERNS = ( | ||||
| re.compile( | ||||
| "^/_matrix/client/unstable/org.matrix.msc3030" | ||||
| "/rooms/(?P<room_id>[^/]*)/timestamp_to_event$" | ||||
| ), | ||||
| re.compile("^/_matrix/client/v1/rooms/(?P<room_id>[^/]*)/timestamp_to_event$"), | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just matched what synapse/synapse/rest/client/relations.py Line 85 in a84744f
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we're trying to not use Is anything using the unstable version that we need to care about or can we just swap right away? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I only know of the Element Web jump to date UI and the Matrix Public Archive.
But those things are experimental along with this endpoint and have no guarantees. For jump to date as it is in Element, it just won't show up since the server will show no support for
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If those are checking for the version flag than it sounds like it should be fine! 🎉 |
||||
| ) | ||||
|
|
||||
| def __init__(self, hs: "HomeServer"): | ||||
|
|
@@ -1421,8 +1418,7 @@ def register_servlets( | |||
| RoomAliasListServlet(hs).register(http_server) | ||||
| SearchRestServlet(hs).register(http_server) | ||||
| RoomCreateRestServlet(hs).register(http_server) | ||||
| if hs.config.experimental.msc3030_enabled: | ||||
| TimestampLookupRestServlet(hs).register(http_server) | ||||
| TimestampLookupRestServlet(hs).register(http_server) | ||||
|
|
||||
| # Some servlets only get registered for the main process. | ||||
| if not is_worker: | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.