Commit graph

946 commits

Author SHA1 Message Date
Bruno Windels 8092713faa add tests for local echo of adding and removing reaction 2021-06-18 11:51:02 +02:00
Bruno Windels 70d64f38eb spelling 2021-06-17 16:07:32 +02:00
Bruno Windels cad884aa41 fix local redaction echo while already sending target 2021-06-17 16:07:09 +02:00
Bruno Windels a77ef02677 cleanup 2021-06-17 10:12:45 +02:00
Bruno Windels cbee498d41 a bit more brief 2021-06-17 10:03:32 +02:00
Bruno Windels bf84b59e39 more accurate test name and also test >= 2021-06-17 09:59:24 +02:00
Bruno Windels 099f99a96b check power levels to see if we can react 2021-06-17 09:41:25 +02:00
Bruno Windels 150f58a6b3 don't aggregate relations on redacted events 2021-06-16 18:00:50 +02:00
Bruno Windels ce5409dc26 aggregate relations when seeing event target during back-pagination 2021-06-16 17:40:29 +02:00
Bruno Windels 9099a76f45 fix spelling in comment 2021-06-16 17:30:48 +02:00
Bruno Windels bbcf0d2572 more local echo fixes for redacting a reaction + cleanup 2021-06-16 12:46:44 +02:00
Bruno Windels 4f10174e48 clarify comment 2021-06-16 10:28:17 +02:00
Bruno Windels 3b629622d9 need to keep pending count around if 0 or less for redaction local echo
also need to be able to tell the difference between no pending reactions
and redactions and the sum being 0 (having both a redaction and
reaction) so we keep isPending to true
2021-06-16 10:23:22 +02:00
Bruno Windels e5c1094153 WIP 2021-06-15 19:06:41 +02:00
Bruno Windels 75ee509361 fix lint 2021-06-11 11:30:11 +02:00
Bruno Windels 757e08c62c WIP 4 2021-06-10 18:29:10 +02:00
Bruno Windels cb051ad161 WIP3 2021-06-09 16:52:30 +02:00
RMidhunSuresh c6f3b1fbbe Do not use private props from room summary
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
Bruno Windels 206d18f498 WIP2 2021-06-08 16:56:17 +02:00
Bruno Windels 2ebadb36c3 WIP 2021-06-08 13:20:55 +02:00
Bruno Windels 3e47877645 Merge branch 'master' into bwindels/reactions 2021-06-04 16:33:10 +02:00
Bruno Windels 33655ee37e forgot to export class 2021-06-04 16:32:03 +02:00
Bruno Windels 7691b28503 prevent another race between sync and openTimeline 2021-06-04 16:28:08 +02:00
Bruno Windels bb6905bdcd don't assume localEntries exists, as load races with sync.afterSync 2021-06-04 16:05:28 +02:00
Bruno Windels b7402ce43c support local echo for adding a reaction 2021-06-04 15:34:44 +02:00
Bruno Windels 8bf160dfc0 handle sending relations to events that haven't been sent yet 2021-06-04 10:48:59 +02:00
Bruno Windels bb8acbefa3 support undoing a reaction 2021-06-03 19:57:16 +02:00
Bruno Windels 20abb01ee8 very basic way of sending a reaction 2021-06-03 19:16:53 +02:00
Bruno Windels 2152d5e833 expose reactions on base message tile as vm with observable list 2021-06-03 19:15:49 +02:00
Bruno Windels b94ab42c90 delete annotations object when no more annotations left 2021-06-03 19:10: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 41fb30c68b add relations store 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 46bfab3eb7 fix some lint and comment 2021-06-03 16:50:11 +02:00
Bruno Windels d965d57be7 don't leak timeline when an error is thrown while opening it
or you are just stuck with "not dealing with race" errors until refresh
2021-06-02 18:44:03 +02:00
Bruno Windels 0c4c018ceb add note that powerlevels won't update when the state event is changed 2021-06-02 18:43:47 +02:00
Bruno Windels d2f5b412ac don't try to hook up local relations for events that are not relations
and do unnecessary work
2021-06-02 18:43:16 +02:00
Bruno Windels 365bd5cad0 fix the race 2021-06-02 18:42:46 +02:00
Bruno Windels 84ecaa2ee1 don't trip over missing create events when loading power levels
as the test from previous commit fails because of that, and powerlevels
works fine without
2021-06-02 18:41:52 +02:00
Bruno Windels 4a8a6168cd add failing test for race between sync & subscribing after openTimeline 2021-06-02 18:41:03 +02:00
Bruno Windels d8acf63e1d change mock event api a bit to be easier to read 2021-06-02 18:38:16 +02:00
Bruno Windels 31075d601f load power levels before decryption closes the txn 2021-06-02 15:06:30 +02:00
Bruno Windels cef94fea45 fix lint 2021-06-02 12:38:41 +02:00
Bruno Windels bf951bd322 fix logging wrong value 2021-06-02 12:34:14 +02:00
Bruno Windels c3754fdbd4 fix the race, make test succeed 2021-06-02 12:34:02 +02:00
Bruno Windels 87ebdbb0b4 add failing test for unhandled race between sync and send
see comments in code
2021-06-02 12:33:15 +02:00
Bruno Windels edbac25613 prepare storage to work with alternative idb impl 2021-06-02 12:31:13 +02:00
Bruno Windels 7a96f84cab also show redaction reason for redaction local echo 2021-06-02 12:17:09 +02:00
Bruno Windels addddf1f26 remove need for transferLocalEchoState, just add local relations again 2021-05-31 16:33:05 +02:00
Bruno Windels 13a4a0169c remove obsolete comments 2021-05-31 16:23:59 +02:00
Bruno Windels 25ce06c9d5 clarify 2021-05-31 15:55:31 +02:00
Bruno Windels 00231443d3 timeline has the own member, so can just use timeline, not ownUserId 2021-05-31 15:18:44 +02:00
Bruno Windels 2bd7c23076 fix lint 2021-05-31 15:08:49 +02:00
Bruno Windels d68d14358f use lower return 2021-05-31 14:08:45 +02:00
Bruno Windels 492a8fe359 remove extra whiteline 2021-05-31 14:05:37 +02:00
Bruno Windels 5d35caf85f no need to emit, timeline finds out by themselves with remote echo 2021-05-31 14:03:22 +02:00
Bruno Windels 23459aad52 check if you are allowed to redact a message 2021-05-31 13:52:03 +02:00
Bruno Windels 63b371b6ef support findAndUpdate with same predicate semantics in SortedArray too 2021-05-31 10:47:32 +02:00
Bruno Windels fa37e8fedb findAndUpdate uses predicate, just add callback to update method 2021-05-31 10:46:16 +02:00
Bruno Windels 2da7ef4280 can only look in remote entries here as PEEs never return an event id 2021-05-27 10:28:02 +02:00
Bruno Windels 5e9ce365bf also apply local relations when loading at top 2021-05-27 10:27:44 +02:00
Bruno Windels a93b1af047 ensure these don't fail on a gap entry 2021-05-27 09:16:25 +02:00
Bruno Windels afc3db2f33 unrelated todo note for later 2021-05-27 09:11:57 +02:00
Bruno Windels 2b5dcff836 consistent naming 2021-05-27 09:11:13 +02:00
Bruno Windels da02b5fe2d transfer local echo state when replacing event entry
e.g. after decryption or remote echo of other relation comes in
2021-05-26 13:10:19 +02:00
Bruno Windels ce7147e463 put redactions in their own view, and allow aborting while still queued 2021-05-26 13:07:56 +02:00
Bruno Windels af45810582 add support for redactions (and relations) local echo 2021-05-21 16:59:29 +02:00
Bruno Windels b55efb7f11 ensure updateEntries is always set in the result of GapWriter 2021-05-21 16:58:04 +02:00
Bruno Windels c934049523 also resolve related event ids when removing remote echo during sync
as /sync races with /send, and remote echo may happen first.
It's important for local echo that the pending redaction/relation
will also get attached to the remote echo before /send returns,
otherwise the remote echo would be "unannotated" until /send returns
2021-05-21 10:52:46 +02:00
Bruno Windels c3fb35848b emit update when receiving event id for related event ahead in the queue 2021-05-20 15:02:45 +02:00
Bruno Windels 619cf9bcbb this should be filter rather than find, we iterate it 2021-05-20 15:02:24 +02:00
Bruno Windels f271517446 log redaction during sync 2021-05-20 15:02:14 +02:00
Bruno Windels 8a8c5569dc provide redact method on tile and room
also add some logging
2021-05-20 14:53:17 +02:00
Bruno Windels 9721432a8c remove pending events that failed because of permanent error
so they don't get stuck
2021-05-20 14:52:30 +02:00
Bruno Windels 4ce66fc8a1 allow concurrent removals when iterating pending events
so we can remove failed events in the next commit
2021-05-20 14:51:04 +02:00
Bruno Windels 618a32e6c0 revert last tried pending event status to waiting when offline
so we don't fail the check if we can immediately remove when redacting
2021-05-20 14:49:54 +02:00
Bruno Windels df9e886f32 fix lint 2021-05-20 13:22:54 +02:00
Bruno Windels b655c34bbb also show reason for redaction 2021-05-20 13:20:12 +02:00
Bruno Windels 780ad44032 render redacted messages 2021-05-20 13:15:35 +02:00
Bruno Windels 94b0bc82ef writing relations is async 2021-05-20 12:50:16 +02:00
Bruno Windels 814e92ad92 fix missing import 2021-05-20 12:50:16 +02:00
Bruno Windels 39bed4b0fc fix lint here 2021-05-20 12:50:16 +02:00
Bruno Windels 9b923d337d write redactions during sync 2021-05-20 12:50:16 +02:00
Bruno Windels edaac9f436 draft redaction support, no local echo yet 2021-05-20 12:50:16 +02:00
Bruno Windels 3724fc6765 log join network call 2021-05-18 11:49:16 +02:00
Bruno Windels c04a8140a3 offer to rejoin archived room from menu 2021-05-18 11:07:46 +02:00
Bruno Windels 9679058081 allow to join room by id or alias 2021-05-18 11:05:31 +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 f5f25c3019 fix DM room names appearing as "Empty room"
because we weren't properly awaiting the heroes to be loaded
2021-05-12 23:07:25 +02:00
Bruno Windels b30b62416c add option to forget archived room 2021-05-12 15:38:54 +02:00
Bruno Windels 5d139dff43 Support deleting data in several stores for room id 2021-05-12 15:38:11 +02:00
Bruno Windels e233caf7ac change order of type and scope in operation index key to scan per scope 2021-05-12 15:36:48 +02:00
Bruno Windels f331d84292 add options menu in room header with leave room option 2021-05-12 13:59:08 +02:00
Bruno Windels afd33f4b77 use constant for member event type 2021-05-12 12:19:05 +02:00
Bruno Windels ca84f485ab fix tests 2021-05-11 17:04:36 +02:00
Bruno Windels 1738a0ea3c need to create archived room when leaving, otherwise it isn't stored 2021-05-11 16:58:16 +02:00
Bruno Windels 8b8214cd1b reference count archived rooms and keep track of active ones
so we don't create two instances for the same id, one for sync, and one
for displaying, and hence updates from sync being pushed on a different
instance than the one displaying, and not updating the view.
2021-05-11 16:09:58 +02:00
Bruno Windels 965700272b remove archivedRoom map, it's unused and just complicating for now 2021-05-11 16:09:01 +02:00
Bruno Windels be7934057e lint 2021-05-11 13:08:13 +02:00
Bruno Windels 51d13fd8d2 update comments for Invite updates 2021-05-11 13:07:57 +02:00