Bruno Windels
6bb8e2fa43
allow loading an archived room
2021-05-07 13:10:10 +02:00
Bruno Windels
243d105aad
support getting the room status for a room: invited, joined or archived
2021-05-07 13:08:39 +02:00
Bruno Windels
36f54420cf
extract RetainedValue from MemberList
2021-05-07 13:06:00 +02:00
Bruno Windels
030b6837ef
rename
2021-05-06 15:27:32 +02:00
Bruno Windels
7e450071b1
clear all room state when rejoining room
2021-05-06 15:27:10 +02:00
Bruno Windels
8c2ae863fd
clean up rejoin storage logic somewhat
2021-05-06 15:26:48 +02:00
Bruno Windels
00d8f81bdd
clear all room state before rejoining room
2021-05-06 14:15:47 +02:00
Bruno Windels
15080edfa7
fix failing test now we don't remove invite from collection anymore here
2021-05-06 14:15:47 +02:00
Bruno Windels
45837f7377
don't set dmUserId when not a DM
2021-05-06 14:15:47 +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
9546b13821
attempt to load sync writer position when joining a room during sync
...
since fragments and events are not archived, just the summary,
attempt to load the room and sync writer during sync,
so we write the timeline correctly and don't cause ConstraintErrors
because unaware of fragments and events already there.
2021-05-06 14:15:47 +02:00
Bruno Windels
07535eedca
when rejoining, room will be archived so consider any non-join a rejoin
2021-05-06 14:15:47 +02:00
Bruno Windels
1258aaee7c
brevity
2021-05-06 14:15:47 +02:00
Bruno Windels
f6957278c3
write and remove archived summary when leaving/rejoining
2021-05-06 14:15:47 +02:00
Bruno Windels
89461bf69a
do all collection removal from sync rather than hand callbacks to invite
2021-05-06 14:15:47 +02:00
Bruno Windels
c2716a061b
pass in userId for kickDetails
2021-05-06 14:15:47 +02:00
Bruno Windels
2cfe7034e8
extract fn
2021-05-06 14:15:47 +02:00
Bruno Windels
b13bfee3d8
support setting kickDetails in room summary
2021-05-06 14:15:47 +02:00
Bruno Windels
85385295a6
don't serialize null values in room summary
...
they only take space in the storage otherwise as we add more fields
2021-05-06 14:15:47 +02:00
Bruno Windels
fd454f1e20
don't expose joinRule prop, as it is protocol specific
2021-04-27 14:26:40 +02:00
Bruno Windels
aaf4e79a73
make media repo available on invite
2021-04-27 11:01:33 +02:00
Bruno Windels
bd748549f7
fix updates in Invite not firing on collection
2021-04-26 10:45:27 +02:00
Bruno Windels
827075bc37
only apply the invite when joining
2021-04-23 18:05:46 +02:00
Bruno Windels
847738a76c
set invite on left room so we can detect a vm refresh is needed
2021-04-23 18:05:14 +02:00
Bruno Windels
2e9ddf9c2c
prevent key collisions between rooms and invites before creating tile vm
2021-04-22 17:22:47 +02:00
Bruno Windels
ec0de15da6
handle overlap with existing timeline when rejoining room
2021-04-22 17:21:29 +02:00
Bruno Windels
ad5d7fc9f0
add note collection emit should happen first in Invite
2021-04-21 15:32:37 +02:00
Bruno Windels
a5e6294593
test accepted/rejected fields in invite tests
2021-04-21 15:32:13 +02:00
Bruno Windels
465e0c191f
add logging to accepting or rejecting an invite
2021-04-21 15:31:55 +02:00
Bruno Windels
5ce138539b
network calls to accept and reject invite
2021-04-20 19:02:45 +02:00
Bruno Windels
bb1c64e1ac
add left panel tile view model for invites
...
and track in-progress state in Invite so it is shared by left panel
and open invite
2021-04-20 19:01:40 +02:00
Bruno Windels
ee98eaa640
restore invites when loading the session
2021-04-20 18:09:48 +02:00
Bruno Windels
5876e5200b
don't need this for now
2021-04-20 18:03:27 +02:00
Bruno Windels
09ac503e22
add test for removing invite
2021-04-20 17:57:03 +02:00
Bruno Windels
d1dc4c9e9c
remove extra layer of log items
2021-04-20 17:56:53 +02:00
Bruno Windels
a072426e07
integrate invites into the sync lifecycle and expose them on session
2021-04-20 17:39:46 +02:00
Bruno Windels
de125441d1
add write/load test for Invite
2021-04-20 17:34:45 +02:00
Bruno Windels
81a35639ba
add Invite class
...
calculating the room name, avatar, etc ...
with empty accept and reject methods for now
2021-04-20 16:21:27 +02:00
Bruno Windels
bdc8451c4a
better logging
2021-04-08 18:39:52 +02:00
Bruno Windels
9e697c6cbe
don't add the pending event again if removed already, fixes #289
2021-04-08 18:36:26 +02:00
Bruno Windels
f976eeaf13
rename SortedArray.replace to update
2021-04-08 18:36:09 +02:00
Bruno Windels
863f659774
fall back to bare userid for local echo profile
2021-04-08 16:30:46 +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
6f37c232f7
Don't cache members that haven't been written yet - fixes #271
2021-04-08 12:56:24 +02:00
Bruno Windels
2b24de838a
actually log initial session backup enabling rather than using null log
2021-03-15 15:24:57 +01:00
Bruno Windels
325d237302
simpler optional log
2021-03-15 15:23:46 +01:00
Bruno Windels
8684d6b5e5
some fixes
2021-03-15 15:23:35 +01:00
Bruno Windels
fcc06b2754
WIP to add logging to decryption and fetching key backups
2021-03-15 14:39:42 +01:00
Bruno Windels
f2dc7728a5
notifyRoomKey was a better name
2021-03-15 14:36:38 +01:00
Bruno Windels
96f060c0a9
also retry decryption for backfilled entries
...
as their event ids won't be stored along the missing key (we only store
synced items so we don't fill up the missing event ids in the store
with undecryptable backfilled event ids)
2021-03-15 14:33:14 +01:00
Bruno Windels
4b62e0a2ce
extract retry event ids for key before overwriting key on key backup
2021-03-15 13:38:27 +01:00
Bruno Windels
cfb521ef10
fix ll events being duplicated in the timeline preventing name changes
2021-03-05 20:10:57 +01:00
Bruno Windels
b37a586094
add clarification why this doesn't need to also check member changes
2021-03-05 17:04:18 +01:00
Bruno Windels
f4a7782298
add MemberWriter, and only return MemberChange's if something changed
2021-03-05 17:03:45 +01:00
Bruno Windels
49fc971d67
cleanup
2021-03-05 17:02:57 +01:00
Bruno Windels
f98f690b49
no need to "serialize" here every time, it just adds noise
2021-03-05 17:02:26 +01:00
Bruno Windels
c1c8f11bf7
fix TypeError when syncing a new e2ee room with keys at the same time
2021-03-05 11:50:54 +01:00
Bruno Windels
e0d14207ac
make opening a txn async again
...
as we'll need to await a bogus request first thing after opening the txn
funny enough, we originally made it sync to accommodate the same bug
in safari, but that didn't prevent any microtask being awaited
before scheduling a request in the calling code closing the txn.
We'll await a bogus request within the transaction class now so it
doesn't depend on the calling code
2021-03-04 19:47:02 +01:00
Bruno Windels
aa23672694
forgot await, this broke updating the timeline when fetching key backup
2021-03-03 17:50:38 +01:00
Bruno Windels
b012b1dc99
Show correct profile for pending messages
2021-03-03 14:53:22 +01:00
Bruno Windels
6771303086
make a method to determine only the retry entries rather
2021-03-03 14:03:50 +01:00
Bruno Windels
404dbcd065
english
2021-03-03 14:03:50 +01:00
Bruno Windels
e7598b9c76
only request key backup for events that are UTD
2021-03-03 14:03:50 +01:00
Bruno Windels
30481a5a9e
add logging to key sharing and discarding in reaction to member changes
2021-03-03 14:03:50 +01:00
Bruno Windels
f3c49e51f2
add, don't replace timeline retry entries
...
also, filter out any that have been decrypted already
2021-03-03 14:03:50 +01:00
Bruno Windels
43547e0901
don't add retried entries to the timeline if they are not already there
2021-03-03 14:03:50 +01:00
Bruno Windels
7f1cdf6841
also decrypt all matching timeline entries when new key
2021-03-03 14:03:50 +01:00
Bruno Windels
3671574547
comment about session backup
2021-03-03 14:03:50 +01:00
Bruno Windels
3bfe52b1dc
filter encrypted events before deciding to decrypt or not
2021-03-03 14:03:50 +01:00
Bruno Windels
9702c4fd64
more logging in sync write
2021-03-03 14:03:50 +01:00
Bruno Windels
8d7cb2a39a
remove unused imports
2021-03-03 14:03:50 +01:00
Bruno Windels
e85844f482
don't redeclare retryEntries, or they won't get passed to writeSync
2021-03-03 14:03:50 +01:00
Bruno Windels
56db210763
attempt at fixing https://github.com/vector-im/hydrogen-web/issues/245
2021-03-03 14:03:50 +01:00
Bruno Windels
c6db23bcfb
WIP to store missing session event ids
2021-03-03 14:03:50 +01:00
Bruno Windels
3fa2d22015
remove isTimelineOpen flag and rather do the check to verify in Room
...
flags are ugly, let's avoid them where we can
2021-03-03 14:03:50 +01:00
Bruno Windels
265a9bd993
applyToEntries does not return anything
2021-03-02 19:39:04 +01:00
Bruno Windels
8d080163b3
reattempt decryption for timeline items
2021-03-02 19:39:04 +01:00
Bruno Windels
061e7abd50
don't break on empty room sync response
2021-03-02 19:39:04 +01:00
Bruno Windels
fb446167f6
make new sync room keys available during decryption of same sync
2021-03-02 19:39:04 +01:00
Bruno Windels
8208464653
only log and clear when actually needed
2021-03-02 19:37:11 +01:00
Bruno Windels
e1821b1753
prevent linking fragment to itself when filling a gap
...
this seems to happen when at the beginning of the timeline and
make the timeline reader go into an infinite loop
2021-03-02 19:31:00 +01:00
Bruno Windels
6f6346d5c3
detect when hitting beginning of timeline when loading timeline
2021-03-02 19:29:55 +01:00
Bruno Windels
1e209b8613
Prevent pending events being skipped when remote echo comes
...
This fixes #241
2021-02-24 14:14:04 +01:00
Bruno Windels
b63ad629a7
can remove console logging here now
2021-02-24 11:25:26 +01:00
Bruno Windels
48c361531d
log clearing unread state of a room
2021-02-24 11:22:19 +01:00
Bruno Windels
376e59820c
more info when logging gap fills
2021-02-24 11:22:07 +01:00
Bruno Windels
1093895133
log opening timeline
...
also load the timeline when opening it in the room, so logging
starts in the room (and we don't need to pass the logger to Timeline)
and also API-wise it makes more sense to
not return uninitialized objects
2021-02-24 11:21:04 +01:00
Bruno Windels
41ecf1db8e
missing semicolon
2021-02-24 10:38:19 +01:00
Bruno Windels
0cbf6008a2
log event id when sending and when receiving remote echo on sync
2021-02-23 19:58:01 +01:00
Bruno Windels
dd38fc13d7
log sending messages
2021-02-23 19:22:59 +01:00
Bruno Windels
57bb75e864
log login & loading a session
2021-02-23 19:22:25 +01:00
Bruno Windels
c6c96a611a
fix iteration bug when disposing pending events at shutdown
...
discovered by logging
2021-02-23 19:04: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
e590b573fb
log remaining specific room entries as detailed
2021-02-18 12:44:19 +01:00
Bruno Windels
f321968ac3
add more sync logging
2021-02-18 12:44:19 +01:00
Bruno Windels
704708bd6c
add some logging to sync
2021-02-12 18:56:26 +01:00
Bruno Windels
764cddcdec
can be cached
2020-11-20 11:45:38 +01:00
Bruno Windels
8b8d06cf3e
show error for attachments still need upload but missing after refresh
2020-11-19 14:42:29 +01:00
Bruno Windels
0581066350
upload smallest attachments first
...
so you don't get a delay at the end of the upload
when starting a new request
2020-11-18 20:09:27 +01:00
Bruno Windels
a23075a326
make safe to call when no attachments present
2020-11-18 20:09:07 +01:00
Bruno Windels
fba5877b3b
dispose attachment blobs when pending event is removed/closing session
2020-11-18 20:08:42 +01:00
Bruno Windels
fd81111bfb
merge state machine from AttachmentUpload into PendingEvent
...
to have less state machines, and we are mostly interested in the
aggregate status of all attachments of an event
this will also drive updates through the pending events collection
that already exists rather than an extra observablevalue, so less
housekeeping to update the UI.
2020-11-18 13:04:23 +01:00
Bruno Windels
83cbe78cd6
report attachment upload progress
2020-11-16 10:45:46 +01:00
Bruno Windels
1dd46b875b
this is fine actually, as it will get encrypted.
...
just don't pass it to the upload
2020-11-13 19:22:06 +01:00
Bruno Windels
0292725076
better formatting
2020-11-13 19:10:18 +01:00
Bruno Windels
262cc8936e
don't leak mimetype for encrypted attachments
2020-11-13 19:10:04 +01:00
Bruno Windels
d2a4242e5b
support multiple attachments per event
2020-11-13 17:19:19 +01:00
Bruno Windels
8b16d8bc99
handle upload failures better
2020-11-11 13:06:03 +01:00
Bruno Windels
af4f3f902f
wait for attachment to be uploaded in send queue
...
also expose attachment from PendingEvent(Entry)
2020-11-11 11:51:39 +01:00
Bruno Windels
48cd4ac95d
track upload error
2020-11-11 11:51:11 +01:00
Bruno Windels
7088b2cdc8
support attachment upload and sending from room api
2020-11-11 10:47:55 +01:00
Bruno Windels
0c70a67ebb
pass platform to room
...
as we'll need it to access crypto and creating blobs
2020-11-11 10:47:19 +01:00
Bruno Windels
32b7b1f064
draft of AttachmentUpload class
2020-11-11 10:46:20 +01:00
Bruno Windels
44a2febce9
hook it up
2020-11-06 23:43:02 +01:00
Bruno Windels
137264edcb
implement subscribing to a single event
2020-10-30 15:19:51 +01:00
Bruno Windels
46fd769dda
(re)move old (compile-time) platform code
2020-10-26 10:34:35 +01:00
Bruno Windels
c8dd7b42e7
encountered this very unlikely race while testing, so prevent it
2020-10-13 13:10:35 +02: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
f993048a2b
Merge branch 'master' into bwindels/idb-promises-txn
2020-09-29 11:33:58 +02:00
Bruno Windels
e5b1cbbcd3
prevent endless loop when restoring messages that were already sent
2020-09-29 11:32:49 +02:00
Bruno Windels
76381fbca1
open storage transactions synchronously
...
this (almost) makes it work in some browsers that otherwise
have throw a TransactionInactiveError on the first operation
you try to do on a store.
2020-09-28 16:06:41 +02:00
Bruno Windels
86df4993e1
prevent room summary from being updated every time it is in /sync resp
2020-09-24 16:45:28 +02:00
Bruno Windels
46abafdccc
ensure cloned is always set to false for this._data
...
by making all assignments of this._data go through applyChanges
2020-09-24 16:40:51 +02:00
Bruno Windels
ece4840653
don't mark rooms as unread after retrying decryption for now
...
this will not mark e2ee rooms as unread if their room key is delayed
though. We should really only do this for back-filled events but that
is hard to do right now, as we don't know the original source here.
2020-09-23 19:11:11 +02:00
Bruno Windels
eb4237f6f4
tell caller if an update was done from summery.writeAndApplyData
...
so room actually emits an update
2020-09-23 19:10:25 +02:00
Bruno Windels
17f84ab314
fix "this" still being used in readRawTimelineEntries ...
2020-09-23 19:09:44 +02:00
Bruno Windels
086bdafe9a
no need for async
2020-09-23 18:28:21 +02:00
Bruno Windels
7cad3b2bdb
some tabs in here
2020-09-23 18:22:51 +02:00
Bruno Windels
64f657e5a2
fix test
2020-09-23 18:20:29 +02:00
Bruno Windels
d53b5eefb3
fill in the blanks
2020-09-23 17:59:42 +02:00
Bruno Windels
9d41e122a0
draft of falling back to reading entries since last decrypted event key
...
this change notifyRoomKey(s) to only take one room key at a time
to simplify things
2020-09-23 17:34:25 +02:00
Bruno Windels
a8392dc684
also decrypt messages in the sync response that enabled encryption
...
like initial sync
2020-09-23 14:26:14 +02:00
Bruno Windels
241176d6fb
WIP
2020-09-22 18:22:37 +02:00
Bruno Windels
0a00d4c865
use hsApi wrapper that handles rate-limiting instead of send scheduler
2020-09-22 13:43:18 +02:00
Bruno Windels
d7c25e3106
move MediaRepository out of HomeServerApi
...
so HomeServerApi becomes easier to wrap, only having methods
that return a RequestResult.
2020-09-22 13:40:38 +02:00
Bruno Windels
ed913ca24b
add dispose to room encryption
2020-09-18 13:08:18 +02:00
Bruno Windels
06ccd74680
this should be read-write, oops
2020-09-17 17:59:35 +02:00
Bruno Windels
9d622434fb
integrate session backup with session class
2020-09-17 15:58:46 +02:00
Bruno Windels
75bff228ec
fix data not being passed on, caused crash on initial sync
2020-09-14 17:45:13 +02:00
Bruno Windels
49f330279b
also pass timeline entries to summary after initial decryption failed
2020-09-14 16:34:07 +02:00
Bruno Windels
f3f07a0672
centralize update emitting in room
2020-09-14 16:33:43 +02:00
Bruno Windels
bce46daa9c
this is shorter
2020-09-14 16:33:30 +02:00
Bruno Windels
8c4d68def9
show decryption errors in timeline
2020-09-14 15:47:00 +02:00
Bruno Windels
0c3ea90ab4
also update room list when encrypted events come in
2020-09-14 15:46:58 +02:00
Bruno Windels
fb69688d47
also update room list when encrypted events come in
2020-09-14 14:01:47 +02:00
Bruno Windels
e763771cc2
cleanup
2020-09-11 14:45:38 +02:00
Bruno Windels
96119b4e58
load all pending operations when starting the session, pass to room
2020-09-11 14:41:40 +02:00