Commit Graph

261 Commits

Author SHA1 Message Date
Krille 29cd5a299a
fix: Type error when uploading room keys 2024-06-25 08:33:35 +02:00
krille-chan 97d544ba85
refactor: Store not uploaded group sessions in its own database queue
This should highly increase the
performance as right now for every sync
ALL inbound group sessions are loaded
from the database and checked if
they need an upload. So if a user
has 10k stored sessions locally, this
would probably let the whole application
lag a lot. This stores the sessions which
need upload in a different table now,
similar how we do this with the to
device queue
2024-05-20 11:28:08 +02:00
td 20a31c1908
feat: famedly calls 2024-04-23 15:52:35 +05:30
Krille 1cb7e8f9ba
fix: Typo in upload key json object creates invalid objects 2024-03-21 08:22:15 +01:00
krille-chan 20073ddd49
refactor: Store lastEvent in room object instead of room state 2024-03-18 13:18:36 +01:00
Krille 544888fe33
refactor: Use maxnumberofotk from olm instead hardcode 100 2024-01-15 13:56:54 +01:00
td dc411c9b14
fix: validate account_data values instead of checking them in syncUpdates 2023-12-20 21:10:31 +05:30
Krille 55bfc92ee0
refactor: Make possible to wait for first sync and await first sync before create megolm session 2023-12-13 14:02:53 +01:00
Krille c3c770bc33
refactor: Remove duplicated copyMap method and fix type error
dynamic.copy returned a type
error so I reverted the previous
change of the copyMap
method to an extension. Also
I found out that we have used
two copyMap methods in the
SDK which did exactly the same.
I deleted the old one and
changed the tests.
2023-12-11 10:29:06 +01:00
Nicolas Werner 2fca08725d
feat: Update dehydrated devices implementation to current MSC
BREAKING CHANGE: This replaces the old dehydrated devices
implementation, since there is no way to query what is supported easily
and supporting both would be complicated.

fixes https://github.com/famedly/matrix-dart-sdk/issues/1579
2023-11-28 11:02:35 +01:00
Nicolas Werner 25f4353ab0
fix: key uploads only running once
There were several issues here. Key uploads in general failed, because
the await caused a Future<dynamic> to be returned, which failed type
checking.

But also we never unset our future, which was used for the online key
backup uploads, which meant we would very quickly stop uploading any
keys at all.
2023-11-24 17:42:57 +01:00
Nicolas Werner 8b8a647cf9
chore: enable discarded_futures lint
BREAKING CHANGE: This changes the runInRoot method to not return a
future. As a user, if you need the result of an async computation passed
to runInRoot, please await it directly. Also the KeyVerification start
and a few call methods now return a future.
2023-11-17 12:59:27 +01:00
Nicolas Werner 5dc3adadfc
chore: enable avoid_bool_literals_in_conditional_expressions 2023-11-17 12:59:27 +01:00
Nicolas Werner 82492f92e1
chore: upgrade lints 2023-11-02 10:20:33 +01:00
Krille 4e310f16d5 feat: Add methods to load all room keys from online key backup
This makes it possible to load
and sync all room keys
right after the bootstrap if the
app wants to do this.
2023-10-20 12:13:12 +02:00
Krille 5c3c85ba3d
refactor: Trigger upload keys on sync and not in background job and upload them before logout 2023-10-20 10:18:05 +02:00
Nicolas Werner bf51e57e78
chore: remove redundant log message 2023-09-19 12:24:06 +02:00
Nicolas Werner 3fb77383a3
fix: wait for online key backup key to be cached on reset
Otherwise uploading the keys won't work, since the key backup is
"disabled".
2023-09-18 17:16:43 +02:00
Nicolas Werner a016709a40
feat: Upload keys on OKB reset
This does make the reset take longer on big accounts, but otherwise
users might sign out before the keys are uploaded, which makes the reset
more destructive than necessary. In the common case of not having any
keys it shouldn't make a difference.
2023-07-31 17:31:04 +02:00
Nicolas Werner eb0759caf5
fix: fix upload of old session after reset
Otherwise we would need to wait for a new inbound session to upload
them. It might increase disk usage a bit every 10 minutes.
2023-07-31 17:31:04 +02:00
td 538865f62a
chore: cleanup some eventTypes and unused variables 2023-06-27 13:46:39 +05:30
td bfda82bb45
chore: fix unexpected null when device is not known 2023-06-27 13:30:05 +05:30
Malin Errenst f310632a83
fix: Assign correct type to signedOneTimeKeys 2023-06-22 17:18:10 +02:00
td 6a0a252912
feat: qr key verification 2023-06-21 19:15:26 +05:30
Malin Errenst 395ef0eb8e
refactor: Use tryGet for type casts whenever possible 2023-06-21 15:04:46 +02:00
Malin Errenst 5943576b1b
refactor: Added type casts to match refactored matrix_api_lite 2023-06-16 12:42:10 +02:00
Malin Errenst 17df38b874
refactor: Added type casts for refactored dart_openapi_codegen 2023-06-16 12:41:29 +02:00
Krille 07ceee4171
refactor: Let bootstrap throw custom Exception InvalidPassphraseException so it is easier to catch 2023-05-30 09:41:10 +02:00
Malin Errenst cc377202da fix: remove deprecated sender_key occurrences 2023-05-08 09:12:14 +00:00
Nicolas Werner 4abefa906b
fix: Always wait for account data to load before returning SSSS status
Otherwise it would be possible, that we haven't loaded account data, so
we return that cross-signing is disabled and then we load it and return
a different result. Might fix the sentry issue for that.
2023-05-03 17:11:00 +02:00
Krille 2c14af9a8b
fix: Reactions are sent encrypted 2023-05-03 13:01:10 +02:00
Krille 05c945b042 fix: Last message set incorrectly on all session key received
This fixes a bug that the
last message was sent
incorrectly when a session
key received for example
from the key backup. It may
fix several issues like the
last message is set as a
very old one or the last
message is not decrypted.
2023-01-18 11:46:32 +01:00
Krille 9d9b1e38ec Merge branch 'krille/store-after-decrypted-last-event' into 'main'
fix: Store decrypted last event in store

See merge request famedly/company/frontend/famedlysdk!1197
2022-12-21 08:24:39 +00:00
Krille Fear 49703f5808 fix: Store decrypted last event in store 2022-12-21 08:43:52 +01:00
Christian Pauly 2f1696bff8 chore: Bump version 2022-12-14 09:00:08 +01:00
Christian Pauly c66d2edb5e refactor: Key manager megolm handling to make key generation more efficient 2022-12-14 08:59:36 +01:00
Reza 7da56ee212 fix: minor stuff 2022-11-24 11:00:10 +01:00
Reza f969a733f1 fix: minor stuff 2022-11-24 10:48:17 +01:00
Reza dd4d0696b3 fix: do not pass the verified device list 2022-11-24 10:19:52 +01:00
Reza 8f37466295 fix: minor stuff 2022-11-24 09:33:36 +01:00
Reza 10cf979877 fix: minor stuff 2022-11-23 19:28:08 +01:00
Reza 44f862b966 feat: start verification with the verified device 2022-11-23 13:43:57 +01:00
The one with the braid 50288698a8 Merge branch 'braid/cute-events' into 'main'
feat: support MSC 3935: cute events

See merge request famedly/company/frontend/famedlysdk!1168
2022-11-21 08:53:44 +00:00
TheOneWithTheBraid 476963069a feat: support MSC 3935: cute events
- add cute event skeletron (`im.fluffychat.cute_events`)
- add cute events to default command batch
- this way, all SDK users can profit from cute events
- supported events: `hug`, `googly_eyes`, `cuddle`

Fixes:
https://rail.chat/@AgathaSorceress@eldritch.cafe/109336005433123570

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
2022-11-21 09:17:07 +01:00
Nicolas Werner dbac5d83dc fix: recover from very unlikely key upload errors
Usually we store the keys we want to upload first, then upload them,
then store, that we uploaded them. So that should be fool proof.

But.

In some cases the filesyste lies to us and the database change isn't
actually persisted yet. That can happen when someone turns of their
phone aprubtly for example. In that case we generate new OTKs with the
same id. Uploading that will fail, since they already exist server side.
We can work around that by manually claiming them and removing them
locally.
2022-11-15 17:18:29 +01:00
Christian Pauly 67fd9cd00e refactor: Improve error handling for no olm session found exception
Finding no olm session can
happen quiet often when there
are dead devices in a room.
We do not need to print the
whole stacktrace then.
2022-11-08 14:02:37 +01:00
Christian Pauly 0a6a813804 refactor: Get rid of unnecessary type cast 2022-11-07 11:09:20 +01:00
Christian Pauly da8ebe85ef fix: Do not try to decrypt redacted events 2022-10-28 12:25:35 +02:00
Nicolas Werner c8a97ce7f8 Merge branch 'krille/on-secret-stored-stream' into 'main'
feat: Add onSecretStored StreamController to SSSS

Closes #331

See merge request famedly/company/frontend/famedlysdk!1135
2022-09-20 07:42:04 +00:00
Christian Pauly f0356532be feat: Add onSecretStored StreamController to SSSS 2022-09-19 15:15:27 +02:00