Commit Graph

1707 Commits

Author SHA1 Message Date
Krille bef9a79f82
chore: Use some call events as last events 2024-01-31 13:48:19 +01:00
The one with the braid 5dc95dea3f
fix: nested void function in encryption helper
- remove the accidentally nested void in the ffiInit implementation

Signed-off-by: The one with the braid <info@braid.business>
2024-01-31 13:29:46 +01:00
Krille d94e6d2ac8
fix: Skip invalid keys which got corrupted in database 2024-01-26 09:41:55 +01:00
The one with the braid 1adbac31ae
feat: add SQfLite encryption helper
This patch introduces a helper class for SQfLite encryption related operations.

Most matrix clients will encrypt their sqlite database at rest. Since
this is a quite fragmented task using the Flutter sqlite ecosystem, this
helper aims to simplify some more complex operations.

It in particular helps with the following tasks :

- loading the correct shared objects / dynamic libraries for sqlcipher
- check whether a database is encrypted
- migrate an unencrypted SQLite database to SQLCipher
- apply the cipher to a database while opening it and ensure it loads

This code is not exactly matrix related, though presumably any matrix
client will use parts of it.

Possible regressions :

- `package:sqlite3` became a direct dependency. As of now it already was a
  transitive dependency of the SDK itself.

Signed-off-by: The one with the braid <info@braid.business>
2024-01-24 10:43:46 +01:00
krille-chan 48ba7556b2
fix: Transactions on web by doing them in the same way as on io
This refactors the transaction
workaround with
"zone transactions" and
abstracts them in a mixin. Then
it just uses this mixin in the
HiveDatabase and the
sqflite_box and also applies
them on indexedDB to
fix transactions on web.
2024-01-22 15:04:29 +01:00
Krille 534a2a4ff1
fix: Correctly null cache in transactions for indexeddb
This is similar to the bug
in the sqflite but now for
the indexeddb.
2024-01-22 14:53:42 +01:00
krille-chan eef79aad2b
refactor: Improve getTimeline senders
This creates a set before
requesting users from the
database. This prevents
doing the same check for
the same user multiple
times and also prevents
concurrent modifications
of the event list.
2024-01-22 13:02:43 +01:00
Krille 4906ae02cf
feat: Add missing localizations for key verification messages 2024-01-22 12:49:27 +01:00
Krille 544888fe33
refactor: Use maxnumberofotk from olm instead hardcode 100 2024-01-15 13:56:54 +01:00
Krille 2afd7040a7
fix: Another type error when combining lists 2024-01-12 16:24:00 +01:00
krille-chan a9508d8941
refactor: Throw client init exception on client init fail
This changes the behavior
when client init fails. It
no longer calls logout and does
only clear local data while
returning all available
information in a new
exception type so that the
SDK consumer can decide
to logout or try again to init
with these information. This
should make it much more rare
that users loose their sessions.
2024-01-05 09:46:38 +01:00
Krille 245cf59205
fix: Type error when combining dynamic lists 2024-01-04 08:30:00 +01:00
Krille 40565464e0
fix: Delete in transaction on new store does not clear cache correctly 2024-01-02 10:01:33 +01:00
Krille 43db98c7b6
fix: Add missing copy map in matrix sdk database 2023-12-27 15:45:44 +01:00
krille-chan b4607be5d0
feat: Make possible to fetch presence from database only 2023-12-27 10:22:54 +01:00
Krille 6955969e36
fix: typerror in removeEvent method from new database 2023-12-27 09:44:54 +01:00
Krille 4c8d7c959c
fix: clearCache does not clear room account data 2023-12-22 13:45:38 +01:00
td dc411c9b14
fix: validate account_data values instead of checking them in syncUpdates 2023-12-20 21:10:31 +05:30
Krille 39527c9033
refactor: Connect timeline to event updates earlier
This creates the timeline object
earlier in the Room.getTimeline() method.
This results to that the
Timeline object already starts
to listen on the event stream
while the getTimeline() method
requests users from the database
and tries to decrypt room
events. I assume that this
causes the problem that
on timeline creation new
events get lost because they
come in, while getTimeline() is
not yet completed but the
onEvent stream is not yet
connected at the same time.
2023-12-20 13:29:35 +01:00
td b6d5ce02c4
feat: add tests for calls 2023-12-19 21:55:30 +05:30
td 6a2f31de39
fix: ignore calls with age older than lifetime
feat: add barebones WebRTCDelegateMock
2023-12-18 21:28:26 +05:30
td 520dfdbe3e
fix: check negotiate party and call ids
chore: making some call naming schemes better
2023-12-15 21:39:06 +05:30
Krille c443e79d29
fix: Increase timeout for initial sync from 10 seconds to 2 minutes
This fixes the response
timeout for the initial
sync and sets it to 2
minutes instead of 10
seconds. This should increase
the speed for the initial
sync especially for large
accounts. This change
also adds some
documentation in the
code about what
timeout does what.
2023-12-15 13:18:10 +01:00
Krille fd1b4eed92
fix: canSendDefaultMessage ignores overwritten events
This refactors three methods
regarding powerlevels. It
makes them a little bit more
readable and removes
unnecessary checks. it
also changes the canSendDefaultMessage
method in a way that it also
checks the events map in the
powerlevels so that it returns
true if message events are
overwritten there. It also
improves the dart docs and
explains in more detail what it
does.
2023-12-15 12:05:05 +01:00
Nicolas Werner e1b80a1f3f
Merge branch 'main' into karthi/cache-get-config 2023-12-14 16:33:50 +01:00
Krille 9dc2f825a3
refactor: Add loadHeroUsers method
This makes it possible to await loading the
hero users to correctly
calculate displayname and
avatar.
2023-12-14 09:16:52 +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
Karthikeyan S db0762ad3f
feat: cache getConfig request 2023-12-13 18:28:44 +05:30
Krille eb869462aa
refactor: Add delete database method
This adds a delete database
method used for migration to
correctly delete the whole
legacy database instead just
empty it.
2023-12-12 12:57:23 +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
Krille 5e2623672c
fix: Copy all maps got from database
Unfortunately we need to copy
all maps. I took the opportunity
and abstracted the copy map
method to utils. I kept the
copyMap method as a
reference in HiveCollections
database to not require a
huge refactoring there as we
are going to ditch it anyway.
2023-12-11 08:32:06 +01:00
Krille b547b7dfe0
build: Add changelog for v0.24.1 2023-12-07 10:24:42 +01:00
Christian Pauly 6db019ae23
feat: Implement new Matrix Dart SDK Database
fix: Edit last event breaks db

feat: Add native sqflite indexeddb database

feat: Split up preload and nonpreload room state boxes
2023-12-06 12:11:47 +01:00
Krille 0b1281358f
fix: Do not hide matrix exceptions in sync 2023-12-05 09:04:51 +01:00
Karthikeyan S 0811b8911b
fix: set cid before initWithInvite to handle getUserMedia exception correctly 2023-12-04 17:41:16 +05:30
Karthikeyan S f4b0a629c7
chore: add null check for remotePartyId before ignoring reject/hangup 2023-11-29 12:32:57 +05:30
Karthikeyan S 6b9be63a4d
fix: ignore reject/hangup events for a live call from a different device 2023-11-29 12:32:57 +05:30
Nicolas Werner 52a5485f7a
fix: don't delete the dehydrated device before we are sure the keys got saved 2023-11-28 11:02:43 +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
Krille 8e9bcc2d36
fix: Delayed encrypted event in timeline not added to aggregated events 2023-11-27 16:12:45 +01:00
Krille 06669cbcac
refactor: Store fetched presence in db and deprecate own cache 2023-11-27 15:48:21 +01:00
Krille 193f404885
refactor: Add SyncConnectionException to syncloop 2023-11-27 09:11:57 +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
Krille 82b885dee0
feat: Add sendRaw command 2023-11-22 15:35:29 +01:00
Krille 029b648f26
fix: Do only convert linebreaks to br tags in p blocks
This changes the behavior
of the markdown method to
only convert linebreaks inside
of p blocks. I found no better
solution yet for the problem
as otherwise also lists
will have linebreaks between
the list items. Unfortunately
the default linebreak syntax
seems not to fulfill our needs.
2023-11-22 11:02:17 +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 a0970b7fcb
chore: don't manually enable default rules 2023-11-17 12:59:20 +01:00
Nicolas Werner e03826b1bb
Merge branch 'main' into krille/better-syncloop-error 2023-11-16 22:21:59 +01:00
Nicolas Werner 0b3542730d
Merge branch 'main' into krille/store-presences 2023-11-16 21:36:13 +01:00