Commit graph

58 commits

Author SHA1 Message Date
Bruno Windels a52740ed1b give room state handler access to member sync to get sender profile info 2022-06-02 15:55:08 +02:00
RMidhunSuresh 520e0f1b89 Use interface ILogItem 2021-11-15 17:29:08 +05:30
Bruno Windels edc3a1d33c convert storage mock to TS and add utility for mock raw database 2021-09-28 14:19:59 +02:00
Bruno Windels b58e10521f don't log tryInsert failures anymore as everything is logged in Store 2021-09-22 10:23:28 +02:00
Bruno Windels 704d7b32da add tests 2021-09-21 21:04:29 +02:00
Bruno Windels 6cded5319a change timelineEventStore.insert to tryInsert 2021-09-21 21:04:10 +02:00
Bruno Windels 53a0d29244 example how to get more context for the failure of a write operation 2021-09-17 18:25:28 +02:00
Bruno Windels 7cb686ce8e convert EventKey to ts 2021-09-06 13:07:41 +02:00
Bruno Windels 7fb5412176 keep comment where it was 2021-08-30 15:12:25 +02:00
Bruno Windels ddb6753f8d fix refactor error 2021-08-27 20:05:53 +02:00
Bruno Windels a61f052fe8 fix lint 2021-08-27 17:23:32 +02:00
Bruno Windels 826de7e9cb Write all members of a sync in one go
so state member events written but not causing a memberChange.hasJoined
don't prevent timeline member events for the same user from doing so
2021-08-27 17:11:29 +02:00
Bruno Windels a78e9af8fc Support (de)aggregating annotation relations in relation writer
When deaggregating on redacting an annotation relation, we remove the
relation and aggregate the other relations for that key again, so we can
reliably detect the first timestamp (and count and me as well to lesser
extent).

as a consequence, more than one event can get updated when redacting a
relation (the relation is updated, as well as the relation target), so
account for that by returning an array of entries that have updated.
2021-06-03 16:50:37 +02:00
Bruno Windels 36a35d92f0 pass ownUserId to RelationWriter
We'll need to to aggregate whether we have reacted to a message

Create writers at room level and pass subwriter is dependency, rather
than creating them in sync and gap writer.
2021-06-03 16:50:37 +02:00
Bruno Windels f271517446 log redaction during sync 2021-05-20 15:02:14 +02:00
Bruno Windels 9b923d337d write redactions during sync 2021-05-20 12:50:16 +02:00
Bruno Windels 8ff1f91d2c bring down lint error count, delete some old, inactive unit tests 2021-05-17 12:59:04 +02:00
Bruno Windels 7defd4a02b ensure the sync is limited when rejoining without overlap
otherwise gap would be lost. The server should do this already,
but we're just ensuring it is, to be more robust.
2021-05-06 14:15:47 +02:00
Bruno Windels 08ba4577f6 rejoin logic was throwing away the prev_batch token 2021-05-06 14:15:47 +02:00
Bruno Windels ec0de15da6 handle overlap with existing timeline when rejoining room 2021-04-22 17:21:29 +02:00
Bruno Windels 813be758d7 we should prefer to not pick the event itself if it's a member event
but still fall back to that if it's a new join
2021-04-08 15:33:21 +02:00
Bruno Windels f67ccc18f4 take most recent member rather than first in timeline for inline lookup
noticed this while inspecting the code, looks related to #269
2021-04-08 12:57:10 +02:00
Bruno Windels f4a7782298 add MemberWriter, and only return MemberChange's if something changed 2021-03-05 17:03:45 +01:00
Bruno Windels 061e7abd50 don't break on empty room sync response 2021-03-02 19:39:04 +01:00
Bruno Windels 57bb75e864 log login & loading a session 2021-02-23 19:22:25 +01:00
Bruno Windels f4a3b64da0 log in sync writer (at detail level) and log room ids at info level 2021-02-19 11:57:17 +01:00
Bruno Windels 07eee8fac1 only create fragments when we will really write events to the timeline store 2020-10-01 17:01:33 +02:00
Bruno Windels 1117c77d05 note for future optimisation 2020-10-01 14:36:00 +02:00
Bruno Windels 9f6822f362 remove needsRoomKey flag on member 2020-09-11 14:38:36 +02:00
Bruno Windels 17412bbb2f more validation 2020-09-10 12:12:39 +02:00
Bruno Windels 650df6fea8 forgot await 2020-09-08 15:00:29 +02:00
Bruno Windels 5a8aac57ac there might not be a member yet 2020-09-08 15:00:20 +02:00
Bruno Windels bbaf3a5605 write needsRoomKey flag when new members joins to tracked e2ee room 2020-09-08 14:22:11 +02:00
Bruno Windels 8482bc95ec pass memberchanges around instead of members
so we can easily tell how their membership changes, (e.g. join -> left)
which we'll need for device tracking.

Not adding this to RoomMember because RoomMember also needs to be
able to represent a member loaded from storage which doesn't contain
this error. A MemberChange exists only within a sync.
2020-08-31 09:50:57 +02:00
Bruno Windels 5d21ae3fb7 fix error on conduit with state field that is missing when empty 2020-08-21 19:10:28 +02:00
Bruno Windels 2bfbb41ee7 send receipt to server when clearing unread state so notif count clears 2020-08-21 15:16:57 +02:00
Bruno Windels 229502ca43 remove logging 2020-08-20 10:48:59 +02:00
Bruno Windels 4b275529f7 fixup: writing member info during sync 2020-08-20 10:47:14 +02:00
Bruno Windels 41c00ce44a write display name and avatar on event during sync 2020-08-20 10:26:08 +02:00
Bruno Windels ba3a4ab8b2 process state events in the timeline together with other timeline events
so member info gets overwritten after all the previous events
have already been written
2020-08-20 09:39:19 +02:00
Bruno Windels d08297d1e0 move RoomMembers to own dir 2020-08-19 16:28:09 +02:00
Bruno Windels bfc5eb3ee5 return changed members from sync writer
we will use it to handle race between /sync and /members
and to update the member list if it loaded
2020-08-19 16:12:49 +02:00
Bruno Windels 2ad9b17ad7 no need to update members, as all the info is in the member event
as we won't store deviceTrackingStatus in the member
2020-08-19 16:10:07 +02:00
Bruno Windels 9ff4f3839c Merge branch 'master' into bwindels/memberlist 2020-08-19 12:13:38 +02:00
Bruno Windels 00a85697ab add license header in all source files 2020-08-05 18:38:55 +02:00
Bruno Windels f5d3092031 WIP 2020-06-26 23:26:24 +02:00
Bruno Windels c379caf4c0 remove obsolete ifdef comments 2020-04-20 21:31:27 +02:00
Bruno Windels 001dbefbcf stop using default exports
because it becomes hard to remember where you used them and where not
2020-04-20 21:26:39 +02:00
Bruno Windels c4a5de20c0 update previous fragment in comparer when appending a new line fragment 2020-03-21 10:45:09 +01:00
Bruno Windels 56c87b3966 better naming 2020-03-14 20:49:15 +01:00