Commit graph

108 commits

Author SHA1 Message Date
Bruno Windels
ddb14f48bf we actually don't need to track write requests
as errors will bubble up to the txn
2020-10-01 14:31:08 +02:00
Bruno Windels
d5a52c32d6 these don't return a promise anymore 2020-09-29 11:51:14 +02:00
Bruno Windels
37690cffe3 track storage write requests internally, as we never await their promise 2020-09-29 11:50:37 +02:00
Bruno Windels
482b5f4d22 allow passing message to IDBRequestError 2020-09-29 11:50:10 +02:00
Bruno Windels
43d430fc98 remove unused storage modification functions 2020-09-29 11:47:49 +02:00
Bruno Windels
7627a2bda2 add comment 2020-09-29 10:53:02 +02:00
Bruno Windels
919357b474 more broken imports after refactor 2020-09-29 09:57:48 +02:00
Bruno Windels
c529df179b also import this 2020-09-29 09:56:46 +02:00
Bruno Windels
c1ecaffbae fix refactor typo 2020-09-29 09:54:51 +02:00
Bruno Windels
07fcf7e75b also do this in try catch 2020-09-29 09:43:25 +02:00
Bruno Windels
b1f9cfd972 cleanup storage errors a bit 2020-09-29 09:17:03 +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
dd30f51ffe add copyright 2020-09-28 15:28:51 +02:00
Bruno Windels
8366b44d8c dont assume global is window 2020-09-28 14:52:12 +02:00
Bruno Windels
98a6d82820 detect when sync promise hack is needed 2020-09-28 14:51:41 +02:00
Bruno Windels
706ec97296 change method name 2020-09-28 13:25:44 +02:00
Bruno Windels
64290d5ae6 flush promises manually in idb event handler 2020-09-25 16:53:19 +02:00
Bruno Windels
1a105d391b cleanup: rename session name to hydrogen as well
as we'll need people to resync because of account data as well
2020-09-17 12:34:10 +02:00
Bruno Windels
7412b3aae8 forgot to commit account data store 2020-09-17 11:38:44 +02:00
Bruno Windels
abfde76e24 store account data in storage
needs a resync, need to think how to handle this
2020-09-17 10:39:51 +02:00
Bruno Windels
3325f12092 remove devices not present in /keys/query response 2020-09-14 15:47:00 +02:00
Bruno Windels
504371eaf3 this is outdated (and not really needed) 2020-09-14 15:47:00 +02:00
Bruno Windels
2855166239 migrate encryption flag so old sessions dont send unencrypted events 2020-09-11 16:48:04 +02:00
Bruno Windels
b00865510f add operation store 2020-09-11 14:40:05 +02:00
Bruno Windels
9f6822f362 remove needsRoomKey flag on member 2020-09-11 14:38:36 +02:00
Bruno Windels
bba53b3477 dont store duplicated key values for replay detection 2020-09-11 12:08:06 +02:00
Bruno Windels
0b26e6f53a compress new e2ee stores into one new idb version 2020-09-11 08:40:43 +02:00
Bruno Windels
a4c8e56ab0 fix getKey not working on IE11 2020-09-09 11:42:26 +01:00
Bruno Windels
da4b710e49 don't return promise here, not used 2020-09-08 18:30:45 +02:00
Bruno Windels
31d4b6f75d send room keys to newly joined members in afterSyncCompleted stage 2020-09-08 14:38:27 +02:00
Bruno Windels
d184be2d22 rotate outbound megolm session when somebody leaves the room 2020-09-08 11:09:09 +02:00
Bruno Windels
c32ac2c764 use decryption result to show message verification status in timeline 2020-09-08 10:50:39 +02:00
Bruno Windels
7bfcfc9eed correct store name 2020-09-04 16:40:51 +02:00
Bruno Windels
f31efe3e87 encode key with proper names 2020-09-04 16:40:39 +02:00
Bruno Windels
32a399afec implement storage changes for megolm decryption 2020-09-04 15:31:00 +02:00
Bruno Windels
be4d887178 add outbound group session storage 2020-09-03 17:49:20 +02:00
Bruno Windels
dde8c66196 implement store changes for olm encryption 2020-09-03 15:33:03 +02:00
Bruno Windels
6d3aa219fa implement storing room keys 2020-09-02 14:24:38 +02:00
Bruno Windels
f5c7b1b3ec remove obsolete comment 2020-09-02 13:35:25 +02:00
Bruno Windels
6aad751611 fix wrong idb method used in session store 2020-09-02 13:35:08 +02:00
Bruno Windels
44e9f91d4c to_device handler for encrypted messages
changes the api of the olm decryption to decrypt in batch
so we can isolate side-effects until we have a write-txn open
and we can parallelize the decryption of different sender keys.
2020-09-02 13:33:27 +02:00
Bruno Windels
6788a612fc implement olm session storage 2020-09-01 17:59:59 +02:00
Bruno Windels
4077f57afb fix typos in stores 2020-08-31 16:09:13 +02:00
Bruno Windels
8b7fdb2c61 create user & device identity stores 2020-08-31 14:38:03 +02:00
Bruno Windels
8b358379e8 first draft of device tracker
mainly missing race protection with /sync and actually running the code
2020-08-31 14:12:12 +02:00
Bruno Windels
f98b3dd5fa create/load olm account before first sync 2020-08-27 19:13:09 +02:00
Bruno Windels
09a018ade1 store sync token and filter id under the same key in session
as they are updated together
2020-08-27 14:36:50 +02:00
Bruno Windels
14b27f81fe store session values as individual values in store
so we don't have to write the whole object every time something changes
we'll use this to store the olm account
2020-08-27 14:28:40 +02:00
Bruno Windels
fe7cc08287 add _selectWhile with proper "while" semantics
the existing _selectWhile method was more like _selectUntil,
which is what we want for _selectLimit but not for selectWhile(Reverse)

The changes we had made before also broke _selectLimit as it would
look at the results length before the value got added so you
always got 1 value more than requested, breaking sync.
2020-08-19 18:25:49 +02:00
Bruno Windels
79363ed1d7 use optional chaining 2020-08-19 18:25:38 +02:00