130 Commits

Author SHA1 Message Date
Benjamin Bouvier
fbabf4fe1b fix typo Subsribe -> Subscribe in function name 2024-07-16 17:14:05 +02:00
Kegan Dougal
dcb8854001 Add more spans for live updates; change when we early return from buffered events
- Add more spans to live updates to account for more time spent in various functions.
- When there are a lot of stacked updates in the buffer, return after processing 100
  of them rather than relying on >=50 list operations. List operations isn't a good
  proxy for the amount of work being done, as the majority of work updates are things
  like: receipts, typing, device list updates. This means we will return faster than
  before when we have stacked updates, reducing perceived latency, despite having to
  still go through the entire buffer.
2024-02-26 12:53:57 +00:00
Kegan Dougal
08d3ec9745 only use the hero avatar if the room is a DM 2024-01-22 10:34:06 +00:00
Kegan Dougal
4c6d504022 bugfix: ensure metadata about space children doesn't leak to active connections
If Alice and Bob are in the same space, and Bob creates a child in that space,
Alice would incorrectly receive global metadata about that child room if Alice
was live syncing at that time. This leak did not expose confidential information
as Alice could receive all that metadata via the /rooms/{roomId}/hierarchy endpoint
already. However, it would cause clients to put the space child room into the room
list which would be very confusing, as it would have no timeline and no other data.
2024-01-12 12:15:38 +00:00
Kegan Dougal
62b3662e29 Interface out store functions from UserCache to make tests happier 2023-11-14 16:12:04 +00:00
Kegan Dougal
c0b8fa05b8 Test prev batches and set prev_batch on live timeline events 2023-11-14 14:48:39 +00:00
David Robertson
eb1ada2f95
Remove OnInvalidateRoom from Reciever interface 2023-11-03 15:43:42 +00:00
David Robertson
84a5ae5dc4
A batch of useful comments
pulled out of #329
2023-10-19 14:17:39 +01:00
Kegan Dougal
f4026d4c1d Deep-copy pointer backed fields on room metadata
Fixes #345
2023-10-19 11:19:28 +01:00
David Robertson
6fb24ad7b5
Stop removing invites on the API side 2023-10-10 17:03:12 +01:00
David Robertson
d4bd2a6fba
Remove unused RequestedLatestEvents field 2023-10-02 19:23:16 +01:00
David Robertson
7e4842660c
Make LazyLoadTimelines only load timelines
Unit tests
2023-10-02 19:23:15 +01:00
David Robertson
54aaa0a301
UserCache.LoadRooms 2023-10-02 18:45:18 +01:00
David Robertson
d3ba1f1c30
Move TimelineResponse back to sync2 2023-09-19 12:41:25 +01:00
David Robertson
957bdee9d2
Merge branch 'main' into dmr/invalidate-timelines 2023-09-19 12:40:13 +01:00
David Robertson
5b32cc44c2
Merge pull request #296 from matrix-org/dmr/cache-invalidation 2023-09-14 11:08:44 +01:00
David Robertson
df01e50438
Pass TimelineResponse struct around 2023-09-13 19:17:53 +01:00
Till Faelligen
264dfbef02
Remove debug logging 2023-09-13 12:43:21 +02:00
Till Faelligen
50ee689ffc
AlwaysProcess only if it was an invite or a kick 2023-09-13 12:38:03 +02:00
David Robertson
0d4e8c6df9
Remove debug and improve comments 2023-09-12 16:25:10 +01:00
David Robertson
636d85b650
Fix bad fmt strings 2023-09-08 18:37:12 +01:00
David Robertson
6628cd33d4
Reload global metadata 2023-09-08 18:18:26 +01:00
David Robertson
afe589921e
Invalidation: don't bother propagating a snapshot 2023-09-08 18:17:13 +01:00
David Robertson
c1cc0eba25
Tell global and user caches to invalidate 2023-09-07 20:41:11 +01:00
David Robertson
777cb357fe
Factor out AccumulateResult struct 2023-09-07 20:41:11 +01:00
Till Faelligen
3510682b58
Add some more tracing and logging 2023-09-07 09:09:16 +02:00
David Robertson
9fc5c91c47
LazyLoadTimelines: ignore messages from ignored senders 2023-08-03 19:07:33 +01:00
David Robertson
4009d13aa6
Track the set of ignored users 2023-08-03 14:11:34 +01:00
David Robertson
a3666722cb
Switch if/elif to switch
This folds more nicely in GoLand
2023-08-03 13:42:29 +01:00
kegsay
a61a3fdde2
Merge pull request #235 from matrix-org/kegan/leave-event-shouldnt-snapshot
Do not make snapshots for lone leave events
2023-08-02 04:53:40 -07:00
Kegan Dougal
6623ddb9e3 Do not make snapshots for lone leave events
Specifically this is targetting invite rejections, where the leave
event is inside the leave block of the sync v2 response.

Previously, we would make a snapshot with this leave event. If the
proxy wasn't in this room, it would mean the room state would just
be the leave event, which is wrong. If the proxy was in the room,
then state would correctly be rolled forward.
2023-07-31 17:53:15 +01:00
David Robertson
f74794bcb4
Include txn_id (if present) in room event updates 2023-07-26 11:52:47 +01:00
David Robertson
81b187d764
Merge pull request #208 from matrix-org/dmr/avatars2 2023-07-19 13:18:14 +01:00
David Robertson
885b42d92d
Lookup correct m.room.avatar field for invites 2023-07-18 19:19:34 +01:00
David Robertson
b4ba770725
Fix an integration test failure 2023-07-18 13:40:12 +01:00
David Robertson
065dcd4630
Fix comment typo 2023-07-18 12:44:26 +01:00
David Robertson
6b9a2217f8
Track changes to avatars when computing deltas 2023-07-18 12:44:26 +01:00
David Robertson
7097c1d279
Track heroes' avatars 2023-07-18 12:44:26 +01:00
David Robertson
5913fbb0f3
Parse m.room.avatar 2023-07-18 12:44:25 +01:00
David Robertson
3861bac4c6
Don't create two Heroes slices to the same array
Otherwise you end up with two slices that share ownership of the same
data but don't coordinate between one another, see e.g.
https://go.dev/play/p/uk3o652Tvye
2023-07-18 12:44:25 +01:00
kegsay
7f2c4eafb1
Merge pull request #178 from matrix-org/dmr/debug-missing-data-at-startup
Debug missing roomIDs/event timestamps seen at startup
2023-07-18 02:46:58 -07:00
Kegan Dougal
baa5d05d31 Use the rooms table initially when querying latest nids 2023-07-13 18:19:00 +01:00
kegsay
b72ad3bded
Merge branch 'main' into dmr/debug-from-stable 2023-07-12 03:41:06 -07:00
Kegan Dougal
aaea223eab Don't needlessly hit the db for txn IDs for live events which were not sent by that conn 2023-07-04 14:20:25 +01:00
David Robertson
f699eabeed
Debug missing roomIDs seen at startup
Sentry: https://sentry.tools.element.io/organizations/element/issues/70026/events/7080aeab1d0b402e987a18f26c1ac329/?project=56&query=is%3Aunresolved
2023-06-20 16:53:04 +01:00
Kegan Dougal
5d619fdfb5 Add LatestEvents struct and use it
This provides a back-channel to send event NIDs
from LL timeilnes to connections.
2023-06-13 10:02:52 +01:00
Kegan Dougal
600c58acf3 Load loadPositions on conn startup 2023-06-09 17:28:01 +01:00
Kegan Dougal
ee2068928f Remove UserCache.latestPos as the race it is protecting against is benign 2023-06-09 15:20:40 +01:00
Kegan Dougal
8b3ea90c3d Remove sentinel NID values 'always process' and 'do not process' 2023-06-09 14:37:13 +01:00
Kegan Dougal
41fa86c127 Remove UserRoomData.LoadPos; it was unused 2023-06-09 14:26:41 +01:00