Commit Graph

121 Commits

Author SHA1 Message Date
Christian Kußowski 6df0fb5d06
refactor: Remove olm dependency 2025-06-10 08:34:49 +02:00
Christian Kußowski 98fcd683a6
refactor: Migrate megolm to vodozemac 2025-06-08 10:18:15 +02:00
Christian Kußowski 31a32b0145
feat: Migrate to vodozemac 2025-06-08 10:18:15 +02:00
Christian Kußowski c618baae70
refactor: (BREAKING) Make database required 2025-05-16 08:28:08 +02:00
Krille 6cd40d3f91
fix: Megolm sessions become invalid after restarting client
This bug seems to be in the
sdk for 5 years already without
anyone noticing. The method
loadInboundGroupSession
seems to return the wrong
variable when loading the
session from the key. While
the outboundgroupsession
loading method relies on
an inbound group session, it
silently marks the outbound
group session as invalid on
every restart and creates a
new one. This means we never
reuse megolm sessions after
restarting the client.

Fixing this will probably reduce
the amount of megolm sessions
used in a conversation by a lot
which could improve the
performance and make the
key backup more reliable.
2025-02-04 10:12:58 +01:00
Krille 86038f8c94
refactor: Use .toSet() instead of Set.from()
When using Set.from() then
it becomes a Set of
dynamics which disables the
Type checking.
By just changing this to
.toSet() it keeps the type.
2025-02-04 09:40:18 +01:00
Krille bc7b987772
refactor: Remove unnecessary roomId parameter from decryptRoomEvent method 2024-12-17 11:23:58 +01:00
Mohammad Reza Moradi 9c32193dff
chore: add require trailing comma lint 2024-11-07 16:13:37 +01:00
Nicolas Werner 15dce00c0f
fix: don't convert archived rooms to joined rooms by accident
When decrypting the last event for archived rooms when a room key is
received, we used to send a synthetic SyncUpdate. This however put the
archived room into the join section, which converted the room to a
joined room. We need to respect what section the room was in when
sending synthetic SyncUpdates.

fixes https://github.com/famedly/matrix-dart-sdk/issues/1916
2024-09-18 11:11:35 +02:00
Krille 4fd616bcbf
fix: Correctly store lastEvent in database after decryption 2024-07-02 08:44:46 +02:00
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 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
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
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 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
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
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 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
Christian Pauly 3976b0f1e2 refactor: Avoid using private types in public api 2022-08-30 11:55:17 +02:00
Krille Fear d30d1a8cf9 Merge branch 'nico/dehydrated-devices' into 'main'
feat: support dehydrated devices

Closes #315

See merge request famedly/company/frontend/famedlysdk!1111
2022-08-29 13:18:02 +00:00
Nicolas Werner dd1f61c29e feat: support dehydrated devices 2022-08-29 13:05:55 +02:00
Christian Pauly 81e55ade67 feat: Allow auto request keys via key sharing requests 2022-08-28 13:59:34 +02:00
Christian Pauly 994faf1012 fix: Decrypt of last event might make an old message as last event
We should only decrypt the
last message in  room if it is
the current last message.
By just fetching the state
we might bring up an old
encrypted message which
is not really the last event.
2022-08-21 14:10:29 +02:00
Nicolas Werner 6555f36d6d feat: switch from pedantic to lints 2022-08-15 14:15:51 +00:00
Lanna Michalke 05ff61ac86 chore: introduce native implementations
- adds Client.nativeImplementations
 - deprecates Client.compute

Allows to properly implement accelerated native operations in web

Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
2022-07-28 13:30:22 +02:00
Christian Pauly 7885281c72 refactor: Use import sorter and ci templates 2022-07-21 15:44:04 +02:00
Nicolas Werner 6e211f5a81 fix: race conditions in the SDK and its tests 2022-07-13 00:36:49 +00:00
Krille Fear 3f3d4d38d6 refactor: Migrate to Matrix Api Lite 1.0.0 2022-05-17 22:50:04 +00:00
Christian Pauly 5fbd0a73a4 chore: Make sure account data and device keys is loaded when using isCached 2022-05-12 13:48:13 +02:00
h.carnot 2cd4eb5e2c fix: remove pendaing outbound group session creation on completed or errored 2022-03-24 13:52:28 +01:00
Lanna Michalke cab03aa73b fix: Allow unpadded base64 decoding 2022-01-11 09:02:34 +00:00
Krille Fear 3bce8b4489 refactor: Remove unnecessary type checks and imports 2021-12-23 11:46:45 +01:00
Krille Fear 03418bfe8b chore: Enable E2EE recovery by default
We have disabled it by default to
prevent using workarounds as
long time solutions and to not
miss bugs. But in a federated
context we can not be sure that
we all Matrix clients are ever
bug free and we have now the
onEncryptionError Stream
anyway.
2021-11-25 15:48:17 +01:00
Krille Fear f3775fa5ba fix: Decrypt last event of a room 2021-11-22 10:18:44 +01:00
Nicolas Werner ebd5bc3d24
refactor: make room nullsafe 2021-10-28 00:54:25 +02:00
Nicolas Werner fb0a84d7b2
refactor: make client nullsafe 2021-10-25 16:34:02 +02:00
Krille Fear d2ee73f96f chore: Bump version 2021-10-25 11:19:45 +02:00
Krille Fear 7a85d52d93 fix: Remove unnecessary null check 2021-10-25 11:11:55 +02:00
Nicolas Werner 60956bde00 chore: port the remaining encryption files to nullsafety 2021-10-13 13:58:21 +00:00
Lukas Lihotzki a7818bbd0f refactor: null safety for all utils 2021-10-05 15:41:25 +02:00