273 Commits

Author SHA1 Message Date
Kegan Dougal
91653ce3d1 Add integration test jig and a basic test
- Add sync3.Response UnmarshalJSON() so we can dynamically make the
  correct single/range op.
- Create sub-structs for sync2.Response to make inline embedding
  easier in tests.
2021-10-25 18:03:32 +01:00
Kegan Dougal
5f19fccd07 Implement unread counts on the client 2021-10-08 14:15:36 +01:00
Kegan Dougal
fb9394d73b Add UnreadTable to track per-user per-room unread counters
With tests. Add function to V2DataReceiver interface.
2021-10-08 12:31:56 +01:00
Kegan Dougal
07950a6acc Handle left rooms in v2 response 2021-09-30 18:23:52 +01:00
Kegan Dougal
f968478387 Set user-agent on v2 requests 2021-09-30 17:32:30 +01:00
Kegan Dougal
33742d331f Add JoinedRoomsTracker and load them from DB on startup 2021-09-22 11:20:00 +01:00
Kegan Dougal
c893efae14 Factor out sync2 since token storage 2021-09-20 18:09:28 +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
5b4b1a10ed Glue to_device stuff into the v3 handler, refactor to prevent import cycles 2021-08-03 12:06:09 +01:00
Kegan Dougal
bcfe9b051f Add to_device table; factor out Chunkify so we can re-use it 2021-08-02 16:45:09 +01:00
Kegan Dougal
9fdf3901df Hook up the notifier and test it
Test that v3 requests can time out, be notified when v2 returns a response,
can return immediately.
2021-07-23 16:40:32 +01:00
Kegan Dougal
90dceee6f6 Add V2DataReceiver interface and indirect via SyncV3Handler
This allows us to notify the Notifier as well as store the data
in the database. Reshuffle where streams live (it's a sync v3 concept).
2021-07-23 15:39:41 +01:00
Kegan Dougal
f3e6b563d4 Refactor tests; add timeout field with token comparisons 2021-07-23 12:23:54 +01:00
Kegan Dougal
f03669ff31 Improve logging; add more typing stream code 2021-07-23 11:07:03 +01:00
Kegan Dougal
749e4d413e Add integration tests on the http handler 2021-07-21 16:35:36 +01:00
Kegan Dougal
747d85e87c Map Auth header to user via /whoami; add query for highest nid
Add stub room list stream
2021-06-16 18:56:31 +01:00
Kegan Dougal
e09c749bdc Add Storage and put Accumulator inside it 2021-06-16 17:18:04 +01:00
Kegan Dougal
91c985755d Fix tests 2021-06-10 18:10:47 +01:00
Kegan Dougal
b7c8a66203 Add stream IDs to typing 2021-06-10 17:08:06 +01:00
Kegan Dougal
4e91518b7c Accumulate typing notifs 2021-06-10 16:51:56 +01:00
Kegan Dougal
a845e69646 Add tests for poller 2021-06-10 11:42:28 +01:00
Kegan Dougal
b0146bb031 Remember since tokens for each device
Tie it to the device so a since-less v3 sync still pulls in stored pollers
2021-06-09 18:13:55 +01:00
Kegan Dougal
29b17b89e5 Shuffle package names around so we don't clash with Go terminology for v2 and v3 2021-06-09 17:27:54 +01:00