Commit Graph

1574 Commits

Author SHA1 Message Date
Nicolas Werner 162436cc8d fix: accidental OTK uploads on internal fakeSync 2021-08-02 20:52:09 +02:00
Christian Pauly 0d72d20cf9 chore: Bump version 2021-07-27 11:29:59 +02:00
Christian Pauly 4ca69e3e1d fix: Missing required field `nextBatch` 2021-07-27 10:50:06 +02:00
Christian Pauly e8d511a371 fix: Missing null checks in syncUpdate handling 2021-07-27 10:49:50 +02:00
Lukas Lihotzki 46b2f8898e fix: use TryGet.optional 2021-07-26 15:33:36 +02:00
Lukas Lihotzki 6d6830505f refactor: implement http timeouts in this package 2021-07-26 15:33:36 +02:00
Lukas Lihotzki 8665f092f4 chore: matrix_api_lite 0.4.0 2021-07-26 14:54:22 +02:00
Lukas Lihotzki bc2dac2ecc refactor: use more specific type 2021-07-26 14:40:15 +02:00
Christian Pauly 115c144cd6 chore: Bump version 2021-07-26 09:48:11 +02:00
Nicolas Werner 179f73db3a fix: Upload OTKs if the otk_count field is missing
fixes #180
2021-07-26 09:47:05 +02:00
Christian Pauly 686bfa3157 chore: Bump version 2021-07-21 16:15:26 +02:00
Christian Pauly 209035ffbd refactor: Use official Dart isolates
The isolates package is discontinued and not compatible
with the newest Dart version.
dart:isolate is not an option because importing this
library makes it impossible to run the matrix
SDK on dart web native. It just won't
build. So we now just depend on
that the flutter app pass through the compute method.
2021-07-21 12:34:43 +02:00
Christian Pauly 66b5f4954e chore: Bump version 2021-07-20 16:06:10 +02:00
Christian Pauly 99c900be9c fix: Add missing null check
With Synapse 1.38 SyncUpdate.accountData is null if it is empty.
2021-07-19 09:18:23 +02:00
Sorunome 5b40088292
chore: Version bump 2021-07-18 18:57:16 +02:00
Sorunome a1594fd9ac
feat: Add general image pack handling as per MSC2545
This also deprecates the old ways to access just emoticons, as the MSC
now covers both emoticons and stickers!
2021-07-18 18:46:32 +02:00
Sorunome ee287a09b9
feat: Add support for nicer mentions
This PR adds support for nicer mentions in markdown: You can now
fetch the mention string of a user with `user.mention` which is
human-friendly (typically contains the display name), which will get
properly pillified upon passing through the markdown parser.
2021-07-18 17:29:25 +02:00
Sorunome 44b7c96d73
fix: preserve homeserver port when creating thumbnail URIs 2021-07-11 13:15:57 +02:00
Sorunome cd5131daa5
fix: Add locking to sending encrypted to_device messages to prevent potential race conditions
Due to chunked lazy sending of megolm sessions it was in theory that we encrypted two olm
messages to the same device in different futures out-of-order. Introducing locking here should
fix this (increadibly rare, so far only theoretical?) race-condition
2021-07-11 13:06:39 +02:00
Sorunome e86353a412
fix: Provide a reasonable well-known fallback
If the well-known look fails (not json, 404, etc.) we should assume a
reasonable fallback (domain part with https prepended). As clients are
expected to call Client.checkHomeserver on the resulting domain anyways
we can safely assume this default, as it is still validated, if there
is actually a matrix homeserver running on that endpoint.
2021-07-11 12:26:48 +02:00
Krille Fear 2980f6d8e3 chore: Bump version 2021-07-10 09:05:12 +00:00
Christian Pauly e86fd7cc07 refactor: Restructure states box and use dedicated members hive box
More description about this here: https://gitlab.com/famedly/company/frontend/frontend-issue-inbox/-/issues/40
2021-07-10 08:38:38 +00:00
Christian Pauly 1e45ed1793 chore: Select range for moor dependency
Publishing to pub.dev is not allowed for a fixed version of a dependency.
We have do select a range of versions. Version 4.x.x should work fine.
2021-07-10 08:38:38 +00:00
Christian Pauly aeb808b5dc fix: Dont migrate from version null
If the currentVersion of the database is null then the database has never been used yet.
Therefore we store the current version and do not call the migrate method.
2021-07-10 08:38:38 +00:00
Sorunome 36a9b53de1
fix: Adjust emoji ranges to have less false positives
Before too many characters, e.g. kanji, were incorrectly detected
as emoji
2021-07-09 20:53:49 +02:00
Sorunome 4735d2d0a8
fix: Sending of the to_device key
With the switch to hive a regression of sending the to_device key was
introduced: When popping elements .deleteAt(), so deleting at the index,
was used, instead of .delete(), so deleting of the key. As the new events
pushed onto the queue used hives auto increment key, a .delete() is
appropriate here.
2021-07-09 19:43:48 +02:00
Christian Pauly 70763daec6 chore: Bump version 2021-07-06 14:41:49 +02:00
Christian Pauly 535a3b1d70 feat: Make it possible to get the current loginState
You may have missed the last valid loginState from the stream if you
listen too late to it. This makes it possible to
get always the current loginState.
2021-07-06 12:25:00 +00:00
Christian Pauly 7c0dd5d8fd fix: Broken nested accountData content maps
If you call BasicEvent.fromJson the given content is copied first
which recursively makes sure
that the Map is from type
Map<String,dynamic>.
Using just the constructor doesnt have this which can lead that nested Maps in
the content is InternallinkedHashMap and
therefore lead to type errors.
2021-07-06 08:11:30 +02:00
Christian Pauly af3a99af1c chore: Pin moor to 4.3.2 to fix the CI errors 2021-07-05 10:59:42 +02:00
Christian Pauly ebc9be250d fix: Mark unsent events as failed
In Moor this was implemented but forgotten in Hive.
Events with status 0 (not sent yet) should be marked as failed on restart.
In fact they should be marked as failed if older than 1 minute. To not have a big startup job which iterates through all events in the database
we just do a time check when opening a room where we iterate through all events anyway.
The new implementation is now in the constructor of the Event and therefore
independent from the database implementation.
2021-07-05 08:37:46 +02:00
Krille Fear e0d3994a46 chore: bump version 2021-06-26 08:33:03 +00:00
Sorunome b664640a05
fix: Don't run syncs while the client is being initialized
Fixes that a sync could be done / processed while the client was still being initialized (loaded from database). This has lead to multiple bugs, such as the verified status of keys getting lost, notifications that come in during app startup displaying oddly, etc.

Additionally, the init lock was released too early; it is now released when the init is actually done.
2021-06-25 13:26:23 +02:00
Christian Pauly 616d25034f chore: Bump version 2021-06-22 15:45:22 +02:00
Christian Pauly 768b0623da feat: Implement sync status stream
This new sync status stream gives the current status of the sync to make it possible
to display in the UI where the sync currently hangs and
what the progress is while updating 1000 rooms. So the app can display a
progress bar.
2021-06-20 15:59:59 +02:00
Christian Pauly c734dc5b9f chore: Bump version 2021-06-20 10:31:50 +02:00
Christian Pauly 96d28a1b76 feat: Implement migration for hive schema versions 2021-06-20 10:31:17 +02:00
Christian Pauly 16f1cb7456 chore: Bump version 2021-06-19 11:06:34 +02:00
Christian Pauly a7ffe4835d feat: Also migrate inbound group sessions
For users who do not use the chat backup this could be useful.
2021-06-19 11:03:52 +02:00
Christian Pauly 4dc62f6150 fix: Make sure hive keys only contain valid characters
There are some matrix IDs like room IDs which contain for example emojis.
This is valid from the spec and some people hack their Synapse to have this.
2021-06-19 10:51:17 +02:00
Christian Pauly c37c5a962e chore: Bump version and update changelog 2021-06-18 10:17:15 +02:00
Christian Pauly 69b52ba85b refactor: Move pedantic to dev_dependencies
The unawaited method from the pedantic package was a historic solution
for the case that you dont want to await a future in an async function.
But now we can do this with just a comment which
is the recommended way to do this now.
This makes it possible to have pedantic as a dev_dependency which means just one dependency less.
2021-06-18 10:15:59 +02:00
Christian Pauly 45a2472fcd chore: Update readme 2021-06-18 10:10:24 +02:00
Christian Pauly c0c7f68bf3 chore: Rename to matrix 2021-06-18 09:58:25 +02:00
Christian Pauly 38d81d6093 fix: Migrate missing device keys
Currently we only migrate the client and SSSSCache but this leads to the
problem that we are no longer self signed after the migration.
We need to migrate all device keys too.
This also abstracts the migration code in a method. init() is too large already...
2021-06-18 09:16:12 +02:00
Christian Pauly 14ee16fe16 feat: Implement new Hive Database
The hive database now implements the whole API except for storing files which
should be better done by the flutter_cache_manager package inside of the
flutter app. All tests already run with Hive now but the Moor database is still
tested too. We needed to change some wait jobs in the tests because the Hive
database is not 100% in memory for the tests like Moor.
For now both database implementations are equal and the developer can pick
which one to use but we plan to get rid of Moor in the future.
2021-06-16 08:43:33 +02:00
Christian Pauly 28dc8b4ff0 refactor: Improve clearing
This makes sure that the database is null after clearing so it will
be built again using the databaseBuilder.
Also this makes sure that the sync has
aborted BEFORE the clearing starts to
get rid of some warnings in the logs.
2021-06-14 11:00:41 +02:00
Christian Pauly fe06b96e93 fix: Do not logout before migration
Before the migration of the databases starts there is always a
logout signal sent. This was wrong.
This also cleans up the logs a little bit
and removes the useless parameters for the second init() call
because those are going to come from the new database anyway.
2021-06-14 08:29:03 +02:00
Christian Pauly 967712adfe feat: Implement database migration
This allows the user to give a legacyDatabaseBuilder to the client object
and in the init proccess the client checks by itself if there is old data in the legacy
database. If yes then it migrates them and
then deletes the old database. This uses the database_api and is agnostic to
the database implementation.
2021-06-11 10:10:18 +02:00
Christian Pauly cfa4441682 chore: Update matrix api lite
To fix the log filtering.
2021-06-10 09:23:08 +02:00