1868 Commits

Author SHA1 Message Date
Kegan Dougal
0546fb3868 Handle expiring connections 2021-09-22 11:43:07 +01:00
Kegan Dougal
33742d331f Add JoinedRoomsTracker and load them from DB on startup 2021-09-22 11:20:00 +01:00
Kegan Dougal
3b71ae5f1c Conn: check that errors are not cached 2021-09-22 10:19:15 +01:00
Kegan Dougal
539fa25ae8 Glue together Conn, Notifier and Handler
For now, /sync requests just echo back what was given in the request.
2021-09-21 16:51:59 +01:00
Kegan Dougal
27a11ee4ce Conn: error handling 2021-09-21 16:17:35 +01:00
Kegan Dougal
62f1eb0ee6 Conn: handle positions, retries and blocking operations
This abstracts the long-pollness of the HTTP connection.
Note that we cannot just maintain a server-side buffer of
events to feed down the connection because the client can
drastically alter _which_ events should be fed to the client.
There still needs to be a request/response cycle, except we
can factor out retry handling (duplicate request detection)
and incrementing of the positions.
2021-09-21 16:00:06 +01:00
Kegan Dougal
d1a14b38d9 Add basic structure for tracking client Conn in a ConnMap 2021-09-20 19:03:38 +01:00
Kegan Dougal
2b2e4493e2 Add synclive handler
This does nothing but pass v2 responses to the storage layer for v2 at present
2021-09-20 18:20:07 +01:00
Kegan Dougal
c893efae14 Factor out sync2 since token storage 2021-09-20 18:09:28 +01:00
Kegan Dougal
80a07e5c1d Factor out handler errors 2021-09-20 17:21:02 +01:00
Kegan Dougal
4ebfb0f725 Factor out the device ID to v2 poller map for reuse in synclive 2021-09-20 17:08:29 +01:00
Kegan Dougal
bad9e0eba5 Remove old sync3 roomlist code 2021-09-20 16:55:12 +01:00
Kegan Dougal
ed6157f752 Add new synclive package for expeirmental sliding windows 2021-09-20 16:53:41 +01:00
Kegan Dougal
e26ec22875 Move sync3 API into a new package 2021-09-20 16:52:50 +01:00
Kegan Dougal
74a591d913 Refactor server to put events in events and event IDs elsewhere
No LRU cache yet
2021-09-09 15:49:22 +01:00
Kegan Dougal
6c58ee96d6 Factor out events into their own section 2021-09-09 15:39:25 +01:00
Kegan Dougal
44ef28e515 Update room list/data API shape from feedback from @bwindels 2021-09-09 14:37:07 +01:00
Kegan Dougal
0fb5b242d9 Add caveats 2021-09-07 17:31:20 +01:00
Kegan Dougal
3403ce6cb3 Update server impl guide and make notif events an array 2021-09-07 17:24:58 +01:00
Kegan Dougal
42cb41092a Blurb on invited/left rooms 2021-09-07 16:40:55 +01:00
Kegan Dougal
9431fc23c0 Modify room list api docs 2021-09-07 16:21:57 +01:00
Kegan Dougal
8c551c6e20 Finish tests for VisibleEventNIDsBetween 2021-08-23 15:58:37 +01:00
Kegan Dougal
bbf9a290f0 Finish out tests for TestVisibleEventNIDsBetween 2021-08-23 15:40:45 +01:00
Kegan Dougal
66c1a8a3e1 Remove membership_log_table and fold behaviour into events_table
Add another index to make queries asking for "all $type events in room X" fast
2021-08-23 15:21:51 +01:00
Kegan Dougal
f99cb64ee4 Begin adding tests for VisibleEventNIDsBetween
The membership log table is more a liability now as it doesn't track memberships
for /sync state blocks, whereas the events table does.
2021-08-20 17:05:17 +01:00
Kegan Dougal
6a851c57e9 Make each generated event ID unique for each test 2021-08-20 16:38:35 +01:00
Kegan Dougal
2ffa81ede2 Don't race when generating new event IDs in tests 2021-08-20 16:32:45 +01:00
Kegan Dougal
d7b70d0afe Implement JoinedRoomsAfterPosition with tests 2021-08-20 16:26:11 +01:00
Kegan Dougal
65cbdb07c8 Add type|state_key cols to events table; refactor select in
- Add `verifyAll` flag to assert if all events should be in the SELECT result
- Factor out `testutils.NewStateEvent`
2021-08-20 15:56:17 +01:00
Kegan Dougal
89f713d9f6 Initial cut at live stream event visibility
Based on membership logs and room snapshots
2021-08-20 11:59:04 +01:00
Kegan Dougal
fcaf228237 Nuke p.next, use next_page instead 2021-08-19 14:42:44 +01:00
Kegan Dougal
45e9e432bc Track the state before on each event rather than after
It's easier to roll forward than roll backwards. Add 'replaces_nid' field
on the events table which tells which nid in the snapshot gets replaced, if any.
2021-08-18 18:21:40 +01:00
Kegan Dougal
8490a68066 Completely re-work how snapshots get calculated
Make them after every state event as we cannot batch them per v2 /sync response
2021-08-18 16:34:44 +01:00
Kegan Dougal
30366983ab Remove snapshot_ref table; it's easier to not track this for now
We still track tokens though so can retrospectively clean up snapshots
2021-08-18 15:50:51 +01:00
kegsay
8d7e35991c
API changes to room_list; removal of room_summary 2021-08-17 17:44:34 +01:00
Kegan Dougal
30b4d3b802 More words 2021-08-17 10:34:54 +01:00
Kegan Dougal
69d6d1d257 Notes on spaces 2021-08-16 18:21:04 +01:00
Kegan Dougal
9dd440751a Remove by_member_count in the room list API for now; keep the surface smaller and extend if need be 2021-08-16 18:03:40 +01:00
Kegan Dougal
eeeb60fc8a Add a question section 2021-08-16 17:25:21 +01:00
Kegan Dougal
0270cbbb8d Chuck in room_member API for completion's sake 2021-08-16 16:50:51 +01:00
Kegan Dougal
0c3a9b687a docs: standardise on next_page and next_batch 2021-08-16 16:41:55 +01:00
Kegan Dougal
0bd2c8f703 Flesh out room data API 2021-08-16 16:34:22 +01:00
Kegan Dougal
738bca7df4 Update room_list API to use fields in docs 2021-08-13 16:01:01 +01:00
Kegan Dougal
823c23da32 Room data todo 2021-08-12 17:23:07 +01:00
Kegan Dougal
0cbbaa420f Some clarifications 2021-08-12 17:15:57 +01:00
Kegan Dougal
0723c448a1 Even moar notes 2021-08-12 17:06:07 +01:00
Kegan Dougal
9c71848fe4 Moar notes 2021-08-12 16:59:59 +01:00
Kegan Dougal
8d88ee9aa6 Lazy updates 2021-08-12 16:34:49 +01:00
Kegan Dougal
898842d42c Room list notes 2021-08-12 16:18:24 +01:00
Kegan Dougal
61975dc6f0 stub room_list stream; make max/default values public for godoc; additional room_member stream tests 2021-08-11 17:08:53 +01:00