mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-14 13:40:39 +00:00
New unstable endpoint POST /_matrix/client/unstable/org.matrix.paginated_sync/sync behind experimental.paginated_sync_enabled. The client sends page_size / limit / history + a single top-level required_state; the server returns the changed rooms (most recently active first, at most page_size of them, at most limit new events each with an explicit per-room gap beyond), plus pending (rooms that did not fit) and total_rooms. The implementation is deliberately a thin layer over sliding sync: PaginatedSyncHandler subclasses SlidingSyncHandler (room data fetch, extensions, connection store and notifier integration are shared), the servlet subclasses SlidingSyncRestServlet (room/extension serialisation shared), and the paging cursor is the existing NEVER/PREVIOUSLY/LIVE per-connection room tracking - candidates that don't fit the page are recorded unsent and picked up next request. Fairness: when more rooms are pending than fit, a quarter of the page is reserved for the rooms whose undelivered updates are oldest. The expanded-timeline hack is disabled for this endpoint (history is /messages' job).