Commit Graph

284 Commits

Author SHA1 Message Date
Christian Kußowski fe94df97db
refactor: Upgrade to vodozemac cryptoutils 2025-09-30 10:07:19 +02:00
Karthikeyan S 6b73fc6354
refactor: migrate to web and js_interop pkgs 2025-09-26 14:08:01 +02:00
Christian Kußowski 7d0a4dc3bc
refactor: Make signableJson type safe with type safe class 2025-08-22 14:06:54 +02:00
Christian Kußowski a6fc1a004d
refactor: Remove dynamic in cross signing code 2025-08-22 13:32:49 +02:00
Christian Kußowski 6df0fb5d06
refactor: Remove olm dependency 2025-06-10 08:34:49 +02:00
Christian Kußowski 5fdcbf8006
refactor: Migrate olm account to vodozemac 2025-06-08 10:18:15 +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 39ce0bf4a4
feat: Make dehydrated device name configurable 2025-04-02 09:27:52 +02:00
td 8b3776aed2
fix: use macv2 for correct base64 encoding 2025-03-28 13:06:42 +01: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 bc328aab5c
refactor: Use Event instead of EventUpdate for storing in db 2025-01-07 14:56:04 +01:00
Krille e7065afe31
refactor: Do not use eventupdate type for verification requests 2025-01-07 12:36:49 +01:00
Krille 9fc7f4a3b4
refactor: Do not handle ephemerals as EventUpdates
This handles room ephemerals
directly and not as room
event updates, which saves
one unnecessary step to json serialize and
deserialize. Handling those
as room event updates had
no benefit anyway so this
should speed up performance.
2024-12-30 11:38:53 +01:00
Krille 017a39c792
refactor: Use Event instead of EventUpdate for pending decryption event queue and for decrypt events in general
This should removes an
unnecessary step of
json serialization and deserialization and should
therefore improve performance.
Gets rid of some unnecessary
code as well.
2024-12-27 13:12:44 +01:00
Krille bc7b987772
refactor: Remove unnecessary roomId parameter from decryptRoomEvent method 2024-12-17 11:23:58 +01:00
Krille 04a46226cb
refactor: Fix new lints from flutter 3.27 2024-12-15 12:21:26 +01:00
Mohammad Reza Moradi 9c32193dff
chore: add require trailing comma lint 2024-11-07 16:13:37 +01:00
Nicolas Werner 6a28ab05d0
fix: Deduplicate key OTK uploads
We do the key upload asynchronously without awaiting it. This means we
may do multiple syncs before the key upload finishes. So we may generate
more keys than we should.

To fix that prevent multiple key uploads from running at once. This may
lead to outdated key uploads in some cases if we miss an OTK being used
in sync. However, the next sync will still tell us about that so in the
worst case this might delay key uploads by 30s (with the default sync
timeout), which for normal usage should be completely acceptable.
2024-10-07 20:55:14 +02: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 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