Commit graph

475 commits

Author SHA1 Message Date
Bruno Windels
150f06b9bf also move to Stopped for aborts 2020-09-22 16:39:04 +02:00
Bruno Windels
85b451ffa1 can't rename named params like this 2020-09-22 15:49:43 +02:00
Bruno Windels
5660e0f4f0 rename send scheduler to request scheduler 2020-09-22 15:49:35 +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
6cd227b82d only prompt after waiting 10s for sync UTD 2020-09-22 09:30:25 +02:00
Bruno Windels
e6a46874c4 wrap olm error for creating session in DecryptionError
so we can relate it back to the event that caused it
2020-09-21 17:58:13 +02:00
Bruno Windels
c9ee5a5db2 stay in catchup mode as long as there are device messages
this implements https://github.com/vector-im/element-web/issues/2782

it also implements 0 timeout for catchup, getting rid of the
catching up with your convo banner for 30s upon reconnection.
2020-09-21 17:57:01 +02:00
Bruno Windels
015c6b1c70 interpret unreported signed_curve25519 as 0 OTKs 2020-09-21 17:56:23 +02:00
Bruno Windels
4dfbd3f3cd don't run afterSyncCompleted and next sync request in parallel
as the otk count the next sync request reports will be outdated
if afterSyncCompleted uploaded OTKs, and the next afterSyncCompleted
, having the wrong server OTK count, will again upload OTKs.

This will overwrite existing OTK keys which will
throw BAD_MESSAGE_KEY_ID when creating new sessions with those OTKs
2020-09-21 17:53:29 +02:00
Bruno Windels
c7370d7b01 Use continue in for loop rather than return
this was running in a Promise.all(array.map)) closure before
2020-09-21 14:11:28 +02:00
Bruno Windels
2c6a3a7ce7 fix afterSyncCompleted not being run after a sync error occurs
the error was not cleared when calling start again.

Also we should better look at the sync status to decide whether to run
afterSyncCompleted.

This prevented the room keys from being applied once you
had a connection error or other error at some point
since you started the app.
2020-09-21 13:55:35 +02:00
Bruno Windels
8cf29e344b don't send access token on /versions
as it's not a good idea, and some CORS configs might not be happy with
an Authorization header on that path
2020-09-18 18:13:20 +02:00
Bruno Windels
4d604f7357 log all sync errors 2020-09-18 13:11:18 +02:00
Bruno Windels
3704de1a26 more dispose 2020-09-18 13:11:10 +02:00
Bruno Windels
da780d0aa2 delay backup 10s if missing session event came from sync 2020-09-18 13:11:02 +02:00
Bruno Windels
3aead4eae2 createEnum does not take an array 2020-09-18 13:08:35 +02:00
Bruno Windels
ed913ca24b add dispose to room encryption 2020-09-18 13:08:18 +02:00
Bruno Windels
6c46cc98de be more specific in error message 2020-09-18 12:12:52 +02:00
Bruno Windels
f58a3ee975 use olm from param 2020-09-17 18:56:02 +02:00
Bruno Windels
7d6fcfafa8 pass olm, better naming, don't reuse var 2020-09-17 18:55:39 +02:00
Bruno Windels
494c5cbcf0 notify UI when we need session backup 2020-09-17 18:00:00 +02:00
Bruno Windels
06ccd74680 this should be read-write, oops 2020-09-17 17:59:35 +02:00
Bruno Windels
1b8e481559 keys from backup need to be imported with import_session, not create 2020-09-17 17:59:02 +02:00
Bruno Windels
915925d6ee don't throw when trying to restore session from backup, check sender key 2020-09-17 17:57:52 +02:00
Bruno Windels
a205ae8841 fixes 2020-09-17 17:57:12 +02:00
Bruno Windels
5752cca69c go back to bs58 and use other base64 decoder
as base-x isn't meant for base64
2020-09-17 17:56:05 +02:00
Bruno Windels
9d622434fb integrate session backup with session class 2020-09-17 15:58:46 +02:00
Bruno Windels
3cebd17cbe adjust paths 2020-09-17 15:17:46 +02:00
Bruno Windels
c9d8d40242 move ssss out of e2ee dir as not really e2ee related 2020-09-17 15:17:00 +02:00
Bruno Windels
33aa475e18 add function to create key from either passphrase or recovery key 2020-09-17 15:16:01 +02:00
Bruno Windels
7f97c540fb obsolete comment, this is already the case 2020-09-17 14:20:42 +02:00
Bruno Windels
092547bfc8 renaming 2020-09-17 14:20:36 +02:00
Bruno Windels
17fc249fa8 integrate session backup with room encryption and megolm decryption 2020-09-17 14:20:15 +02:00
Bruno Windels
3941af93d2 more impl of SessionBackup 2020-09-17 14:19:57 +02:00
Bruno Windels
fff8308259 first draft of SessionBackup 2020-09-17 12:34:39 +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
b7401a148c some ssss cleanup 2020-09-17 12:33:57 +02:00
Bruno Windels
8204e942d9 first draft of reading a ssss secret 2020-09-17 11:39:40 +02:00
Bruno Windels
c44ab3e55e derive ssss key from recovery key 2020-09-17 11:39:25 +02:00
Bruno Windels
7c4c266fe0 derive ssss key from passphrase 2020-09-17 11:39:07 +02:00
Bruno Windels
45c62eb0e5 common types and storage for ssss 2020-09-17 11:38:53 +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
00eade1c16 add crypto driver with primitives needed for 4S & session backup 2020-09-17 10:19:09 +02:00
Bruno Windels
12262f2824 actually use correct method to get all device ids for a user 2020-09-14 18:31:54 +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