Commit Graph

2107 Commits

Author SHA1 Message Date
td 10687d88a1
fix: do not fire missedCall on answeredElseWhere 2024-05-30 15:38:10 +05:30
Krille 4d9b0f6574
fix: Do not return invalid state events from database 2024-05-29 12:07:40 +02:00
Krille 14b8ceb2eb
refactor: requestUser logic 2024-05-29 10:08:46 +02:00
Krille a21ead8cd5
fix: Requst profiles for left users
This has been set to false
to prevent storing global
user profiles as member states
in the database. However
looks like this is already
solved below. We can
safely store the profile
in the local cache, otherwise
we cannot calc the body
for an event synchroniously.
2024-05-29 10:04:32 +02:00
Krille 491313ae7d
refactor: Use enhanced enums for room enums 2024-05-28 14:25:38 +02:00
krille-chan 885aeb3c17
refactor: Deprecate Streams in favor of client.onSync
This deprecates all streams which can
be created by using client.onSync
anyway for a more predictable state
handling in consuming apps.
2024-05-28 13:48:31 +02:00
Nicolas Werner 51dbb90436
fix: canRequestHistory doesn't reflect reality
canRequestHistory could become false, even though you didn't load all
events from the database yet. So you had to either rely on fetching
until the requestHistory method throws or rely on other workarounds.

This makes requestHistory not throw, when the prev_batch is null, but
also makes canRequestHistory return sane values (but might require an
extra request, that does nothing).
2024-05-27 14:55:11 +02:00
td 06728b4b75
fix: make sure room is postLoaded before starting calls
more logging
2024-05-23 14:10:20 +05:30
td 25437f8a18
fix: nonLocal join/left values 2024-05-22 22:55:41 +05:30
td 79960d1be3
fix: Do not set messages as state events anymore
We had this as a workaround and forgot to remove it after the database migration to the new way how to store the last message.
2024-05-22 22:22:56 +05:30
td fd6c7a1016
feat: preShareKey using fetchOrCreateGroupCall
fix: only fire backend.onNewParticipant and backend.onLeftParticipant when it is not the local participant, this fixes the issue where onNewParticipant would get triggered when it detects a new call even though you were not in the call, as of now there is no code in those functions which needs to be triggered before you have joined the call so this should be fine

chore: also improve participants join leave tracking logic
2024-05-22 22:15:00 +05:30
td 48043ec753
feat: hide _makeNewSenderKey and expose a new preShareKey function
also bumps version
2024-05-22 19:06:33 +05:30
td d313cbb18e
feat: make voip key generator public
with this you can now send the key before joining the call to the participants, make sure to call onMemberStateChanged first to ensure groupCall.participants is populated
2024-05-22 18:19:18 +05:30
Krille f3e631b2eb
fix: Hotfix create missing objectbox 2024-05-21 13:07:36 +02:00
td b5fb43af51
chore: add MatrixSDKVoipException and some more logging 2024-05-21 15:47:19 +05:30
td 39a8b8ce89
chore: throw exception if you cannot send famedly call member event 2024-05-21 15:07:44 +05:30
td d10befcac5
fix: allow famedly calls for everyone before choosing an existing one 2024-05-21 15:04:25 +05:30
td d4566d7512
fix: minor perm issue typo while setting famedly call member event 2024-05-21 15:02:30 +05:30
Krille 4d60c8f023
refactor: Make network request timeout
configurable
2024-05-21 08:30:34 +02:00
krille-chan c5e6a89f05
refactor: Combine sendMessageTimeoutSeconds and sendTimelineEventTimeout
Those timeouts were basically the same
and both had the same default value
1 minute. I guess it was just a
mistake to duplicate this.
2024-05-20 16:57:55 +02:00
Karthikeyan S 29e554337c
perf: check event size in bytes without encoding twice 2024-05-20 16:40:15 +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
Karthikeyan S eef3fd1dfc
fix: update event status to error on EventTooLarge 2024-05-16 19:12:25 +05:30
Krille 93bf30f376
refactor: Make client members read only 2024-05-16 07:23:30 +02:00
Krille 5a79aa9536
refactor: make sure ensureNotSoftLoggedOut does not run multiple times 2024-05-14 10:40:32 +02:00
Krille 3f8a4c8189
feat: Implement unpublished MSC custom refresh token lifetime 2024-05-14 10:40:32 +02:00
Krille 039c214e7a
fix: ensureNotSoftLoggedOut must be called before network reqeust in syncFilter check 2024-05-14 10:13:45 +02:00
td 59703aef75
fix: ice restart mechanism 2024-05-13 22:07:38 +05:30
krille-chan 42f44de2b1
refactor: Cache direct chat matrix ID
The direct chat account data
content is a map from matrixId
to roomId(s). If we want to find
the roomId for a given userId,
then this is not a problem. But
the other way around, if we
want to check if a given roomId
is a direct chat or not, needs to
process all entries which can be
hundreds. Doing this very
often in an app costs a lot of
performance. This adds a simple
cache in the room object and
validates the cache every time
to make this more efficient.
2024-05-10 10:52:27 +02:00
Ray Wang e9825f7f40
feat: support for JWT authentication
Signed-off-by: Krille <c.kussowski@famedly.com>
2024-05-10 10:39:58 +02:00
Krille 1dbb81ed83
chore: Revert check message size before fake sync
This lead to the huge problem that there is no
user feedback between sending a message and
seeing it in the timeline as it is encrypted
before the first user feedback is shown. But
the encryption step is async and also includes
fetching devices if necessary so that can take
seconds or even forever on bad internet
connection.

This reverts commit 981c3ea94d.
2024-05-10 08:22:09 +02:00
Krille 501c457ea1
refactor: delete not sent events without eventupdate stream workaround
This fixes several problems. First
sending a fake event through the
onEventUpdate stream was not a
good design and lead to problems
if you expect a timeline event but
then are unable to build the
event from json. This now uses
a new stream in the Client which
is listened to in the timeline to
delete an event which should be
much more reliable.
It also now throws an exception
if deleting the event fails
instead of returning true or false.
A deprecation note is added.
2024-05-08 12:02:55 +02:00
Krille bf5bf2adb0
refactor: Removes the behavior of deleting an event if the file is no longer cached
This brings more problems than it
helps. It leads to bugs like flickering
of sending images and also
confuses the user. This should
either be handled by the app
or the user.
2024-05-06 14:59:45 +02:00
Krille a1a542d98e
refactor: Create StrippedStateEvents for invite rooms when loading from db 2024-05-06 09:42:05 +02:00
Krille 5b46ae6e31
refactor: Use strippedstatevent as base for room state and user class
Before we have used the Event class for all
state events while for invite rooms those
actually were StrippedStateEvent objects. This
created some problems like we needed to set a
fake originServerTs (usually to DateTime.now()).
Actually we don't need the additional keys for
state events most of the time so just using
StrippedStateEvent for all states and typecasting
them to event where needed is not much of a
hassle while we benefit from a more clear
structure.
This also now uses StrippedStateEvent as a base
class for the User class which makes the User
class more minimal as keys like event_id and
origin_server_ts are no longer necessary. As we
create a lot of fake User objects where we had to
put fake values in it, it brings more benefits
than problems to just get rid of those fields.
2024-05-03 14:06:49 +02:00
Krille 8c98a0058a
ci: Add tests for database on web 2024-05-02 11:18:35 +02:00
td c5b5a1cf14
chore: reduce isValidMemEvent log level 2024-04-30 21:40:43 +05:30
td a2e8830df0
chore: expose fake matrix api 2024-04-30 17:42:36 +05:30
td 0ff643f652
fix: allow mesh group call invite 2024-04-30 17:12:25 +05:30
Krille 7ed809d748
refactor: Remove unused variable 2024-04-30 07:52:43 +02:00
krille-chan a8214832c0
fix: Fetch invite state after restart app
This makes sure that the
users for an invitation are
correctly loaded so that we
can display the avatar, the
room displayname and
wether the room is a direct
chat or not.
2024-04-29 15:33:54 +02:00
td 66bd16208d
chore: update voip readme 2024-04-26 20:07:20 +05:30
morguldir df6c11775d
fix: Don't fail sync if a presence event has an empty presence field 2024-04-26 13:08:01 +02:00
td 20a31c1908
feat: famedly calls 2024-04-23 15:52:35 +05:30
td 281510b950
feat: lcov and tag olm tests 2024-04-23 15:21:46 +05:30
krille-chan 4732580c3d
fix: Make room.setPower more type safe and avoid change powerlevel in RAM before sending request to server
This fixes the bug that the
actual dart Map in the state
has been manipulated because
we have not worked with a
copy of the map. Also this
crashes if the powerlevelmap
would had a wrong type in
users.
2024-04-18 10:56:28 +02:00
krille-chan 00616f02ac
refactor: Use prevBatch from server for pagination in event search
When using the searchEvent()
method it was impossible to
paginate to the next
chunk when one chunk had
0 returned events. This
fixes it by returning the
prevBatch and makes it
possible to insert the prevBatch
again. sinceEventId is still
working but now deprecated.
2024-04-18 10:32:27 +02:00
krille-chan edcf331bf3
fix: canChangePowerLevel should return true for own user 2024-04-17 12:56:34 +02:00
td 24ccf5eeff
fix: remove msc3245 key from audio events
looks like we do not support this anyway and this confuses bridges, basically removes all voice message related things from the sdk
2024-04-12 15:53:13 +05:30
Krille 9099dd74c0
chore: Pass reason parameter when invite user to a room 2024-04-12 11:30:59 +02:00
Krille 49e6d55d32
refactor: Move file storage to mixin to not import dart:io
Original issue and former solution by
The one with the braid <info@braid.business>
Special thanks for pointing out the problem.

This fixes that dart:io is imported into the
SDK database by moving it into it's own mixin which
makes it reusable and platform independent by
using conditional imports.
2024-04-12 08:51:48 +02:00
The one with the braid 4ba6e25689
fix: dart:io import in matrix_sdk_database
- removes `Directory` field in high-level `MatrixSdkDatabase`
- migrates `Directory fileStoragePath` to `Uri fileStorageLocation`
- makes file operations in `MatrixSdkDatabase` conditional on
  `dart.libraries.js_util`
- implements a tiny stub of the file operations used in `MatrixSdkDatabase`

It seems like the Flutter tool can compile despite these imports. Sadly
the Dart standalone dart2js compiler doesn't reach there. While
refactorying the code, I decided it's likely cleaner to have a `Uri` as
storage location provider than using some fake directory or String as
relacement.

The advantage of a `Uri` at this place is the explicit `Uri.directory`
constructor available to ensure type and encoding safe directory
locations supporting both Windows and *nix.

Additionally, admitted, that's an edge-case, one could even
easily extend the use of a `Uri` based descriptor to support future
storage location accesses (e.g. IPFS or custom schemes for e.g. local
web browser based file system APIs). Using a `Uri`, one would only need
to override the three methods making use of the `fileStorageLocation`
property to handle different Uri schemes too.

Signed-off-by: The one with the braid <info@braid.business>
2024-04-12 08:50:44 +02:00
Krille 70eb3e3431
docs: Add documentation 2024-04-11 15:36:30 +02:00
krille-chan d0b1d4a651
fix: Do not use invitor avatar_url for room
When user A invites user B to
a group chat, the avatar getter
should not return the
avatar of the inviting user A.
This is not intuitive. A client might
decide to do so but IMO it makes
no sense to do this by default.
If the
room is a DM invite, user A's
avatar is already used in the
code block before.
2024-04-11 11:39:20 +02:00
Krille 849bd7ca9b
refactor: Make via fields not nullable 2024-04-11 11:32:23 +02:00
Karthikeyan S 883785db86
feat: add sendAudioEvent and isVoiceMessage method to msc extensions 2024-04-11 14:12:54 +05:30
td f7a4518c5f
fix: userMediaConstraints 2024-04-09 00:39:23 +05:30
Krille 0e867402bc
chore: Sort archive by last activity 2024-03-26 13:30:06 +01:00
td 981c3ea94d
chore: check message size before fake sync 2024-03-25 19:31:01 +05:30
td e08cf742e6
chore: add api lite readme 2024-03-25 17:46:59 +05:30
td cd94cf62a8
chore: merge api_lite and dart sdk 2024-03-25 17:22:05 +05:30
td 691190f07a
Merge remote-tracking branch 'api/td/justUseMV' into td/api 2024-03-22 21:41:45 +05:30
td b7befd781e
chore: git mv 2024-03-22 21:24:21 +05:30
Krille e266ef7312
refactor: Switch to MatrixSdkDatabase as suggested database and deprecate other ones 2024-03-22 16:05:08 +01:00
Krille 1cb7e8f9ba
fix: Typo in upload key json object creates invalid objects 2024-03-21 08:22:15 +01:00
Krille 2456a64f37
refactor: Use dart records for checkHomeserver method
This makes use of dart
records to return three
different values for one
method. This makes the
special class no longer
necessary just for
returning data.
2024-03-18 15:20:31 +01:00
Krille b90b902218
refactor: BREAKING Migrate database to new lastEvent storage method
This changes the way how the last event is stored
for each room. It is now stored next to the
room event itself in the rooms box and no longer
stored like a room state. This way we need to
bump the database version which will cause an
inital sync for the client. Be aware of this when
updating the SDK!
2024-03-18 14:11: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 0ae71fa843
feat: Add commands /ignore and /unignore 2024-03-15 10:13:11 +01:00
Krille 3d09219269
feat: Offers client.ensureNotSoftLoggedOut() to fix using client with stopped sync loop
This also makes sure that
the access token is
refreshed when calling
client.getEventByPushNotification()
which is porbably the most
common case for a client
with a stopped sync loop
doing network requests.
2024-03-14 14:49:47 +01:00
td a60a0cad69
fix: throw EventTooLarge on exceeding max fed PDU 2024-03-14 01:18:10 +05:30
td 1e90fcee93
chore: add noice/echo cancelling flags to getUserMedia 2024-03-11 10:45:43 +05:30
Krille d049e667ee
refactor: BREAKING Allow calling init when in soft logout state and fix some bugs
This fixes several problems with current soft logout
handling, as it now stores the refresh token correct and
only refreshs it 1 minute in advance instead of 5
minutes.
2024-03-07 15:49:23 +01:00
Romain GUILLOT 22df8b39a8
feat: add fromLocalStoreOnly to Event.downloadAndDecryptAttachment
Signed-off-by: Romain GUILLOT <romain.guillot@arche-mc2.fr>
2024-03-06 12:13:07 +01:00
Nicolas Werner f6fa9df2c5
fix: archived room state store logic
This was implicitly relying to the timestamp of state events getting
compared in the setState function. Fix this by using the helper
functions already used for invite and join rooms.
2024-03-04 19:31:35 +01:00
Nicolas Werner 1bde841cb2
fix: properly fetch participants when transitioning from invite to join
We used to add app the member counts of invited users and joined users,
which would make us assume the participants list is complete. Which
would mean we always return the wrong state.

Additionally there is no need to rely on if we have a cached response.
Instead we always only check for completeness instead of possibly
returning stale responses just because we fetched the members once.
2024-03-04 17:55:29 +01:00
Nicolas Werner 582963ab91
fix: Do not compare timestamps when setting roomstate
We now handle state in the correct order in the sync handler. Using the
timestamp lead to false results when we still generated a default
timestamp of "now" for events, however even without that state events
can have an older timestamp like when accepting an invite on a server
with the clock behind by a minute and we should instead rely on the sync
handler giving us state in the right order.
2024-03-04 17:53:23 +01:00
Nicolas Werner 6f82e92f2c
fix: properly overwrite loaded state for partial loaded rooms
Otherwise invites, which get converted to normal rooms, might still have
old member events set in memory, that don't match the current state.
2024-03-04 17:52:06 +01:00
Nicolas Werner 5ffa99d994
fix: Do not assume a missing timestamp means "now"
This causes issues with state handling as we prefer the newer event. It
also has knock-on effects in other places. Instead set such events to
have an obviously invalid timestamp, which makes issues easier to
identify.

This may break invites showing a timestamp or the timestamps for just
sent events, if you rely on the timestamp getting set to "now".
2024-03-04 17:49:50 +01:00
Patrick Hettich 81f33951bb
Merge branch 'main' into pat/archive-room-names 2024-03-01 12:03:00 +01:00
Krille 4b44af0eb8
chore: pass refreshToken to uiaLogin 2024-02-29 14:10:48 +01:00
Patrick Hettich 78c610ab92
Merge branch 'main' into pat/archive-room-names 2024-02-29 12:03:45 +01:00
Patrick Hettich 18ce3607c6
fix: removed prev_sender for empty chats 2024-02-29 11:57:32 +01:00
Krille 1b93471d64
refactor: Deprecations after dart upgrade 2024-02-28 12:37:54 +01:00
Krille 65c56f3630
feat: Store accesstokenExpiresIn and call softlogout 5 minutes before 2024-02-23 13:06:38 +01:00
Krille 38b1eb75e5
feat: Implement handling soft logout 2024-02-23 13:06:38 +01:00
Gabby Gurdin 4a4eb53dad
fix: convert boxNames to List in clear function when creating transaction 2024-02-23 12:53:37 +01:00
Karthikeyan S b82d8bff0b
feat: specify history_visibility when creating group chat 2024-02-22 15:22:10 +05:30
Patrick Hettich 9b9e311010
fix: updated membership-leave for archived direct chats 2024-02-21 08:16:10 +01:00
td 3fba9a55b3
chore: remove state events both in imp and preview events list 2024-02-20 06:54:11 +05:30
Patrick Hettich 77561ced07
fix: Use name of other participant on archived rooms 2024-02-16 11:47:26 +01:00
td aa77812e8e
fix: ignore expired calls rather than killing them 2024-02-14 03:27:09 +05:30
td c2a2e419cb
fix: group calls terminator having sync glares
this will be removed with the new calls, we should ignore expired calls rather than cleaning up unless you have complete ownership of the event
2024-02-13 11:34:28 +01:00
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
Krille d1bbf57b6f
fix: Set presence when loading archive 2023-11-15 14:18:48 +01:00
Mohammad Reza Moradi d5447c62f7
fix: hangup on call crash 2023-11-15 08:49:35 +01:00
Krille 8cc863b1a3
feat: Store presences in database 2023-11-15 06:59:58 +01:00
td 1ab06cb01a
fix: clear local database on logout even if server timesout 2023-11-13 18:12:47 +05:30
Karthikeyan S 243275d644
Merge branch 'main' into karthi/fix-hangup-timeout 2023-11-06 17:31:22 +05:30
krille-chan b1b2b2ffe2
fix: catch correct exception type for connection problems 2023-11-05 09:52:08 +01:00
Nicolas Werner 37582a3a8e
fix: stale call checker leaks memory 2023-11-04 00:30:14 +01:00
td 579b8aa944
Merge branch 'main' into karthi/fix-hangup-timeout 2023-11-03 19:22:01 +05:30
Karthikeyan S 88110773ab
fix: call hangup on timeout race condition 2023-11-03 16:05:37 +05:30
Nicolas Werner 82492f92e1
chore: upgrade lints 2023-11-02 10:20:33 +01:00
Nicolas Werner 620187c772
Merge branch 'main' into braid/store-left-rooms-in-archive 2023-11-02 08:49:48 +01:00
Krille f0e4232930 refactor: Wait for room in sync until sync process and trigger cleanup call not before actually start clean up. 2023-10-23 12:30:14 +02:00
Krille 6f144198b7
fix: Do not convert linebreaks in pre blocks on markdown parsing 2023-10-23 08:39:26 +02:00
The one with the braid 5dea95f02c fix: Code style
Signed-off-by: The one with the braid <info@braid.business>
2023-10-20 14:58:56 +02:00
Clemens-Toegel f1fd6f43f9 chore: remove archived room on forget (#2)
Co-authored-by: Clemens Toegel <clemens.toegel@x-tention.at>
2023-10-20 14:04:11 +02:00
Clemens-Toegel 0ec6a64cc8 chore: store states to archived rooms (#1)
* chore: store states to archived rooms

* chore: PR fix

---------

Co-authored-by: Clemens Toegel <clemens.toegel@x-tention.at>
2023-10-20 14:04:11 +02:00
The one with the braid 053dddb76d chore: incrementally add left rooms to archive
- store left rooms in archive during sync (as well as they are removed
  on join already)
- refactor room archive code
- fix typo

Internal reference: SMC-385

Signed-off-by: The one with the braid <info@braid.business>
2023-10-20 14:04:11 +02: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
Ray 4b51c1c5fd fix: fixed hardcoded historyCount 2023-10-20 11:25:45 +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
Krille b5b5cfee5e
fix: Convert linebreaks into br tags on markdown parsing
Removes two test cases in the markdown test which do not work anymore.
Reason for this is that just parsing a word inside of $$ word $$
katex is not valid anyway because katex is only made for mathematical
things. So the output is undefined behavior anyway.
2023-09-29 09:24:50 +02:00
Krille 5dd444daf2
refactor: Update markdown 2023-09-28 08:09:17 +02:00
Nicolas Werner 97bf7723dd fix: Wait for rate limit to pass while sending messages
Otherwise the user can't handle that exception themselves, since we
don't rethrow.
2023-09-21 13:04:57 +02:00
Krille 8ac86a883d
feat: Implement member change type
For easier handling and
comparing of m.room.member
state events to better
know what these event
actually changes.
2023-09-19 16:19:42 +02:00
Nicolas Werner dab7f6667e
Merge branch 'main' into nico/fix-okb-bootstrap 2023-09-19 14:02:18 +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 500e423c00 fix: storing the end of history pagination
At least in our CI this throws a null assertion error and since we
explicitly expect this to sometimes be null in our code, we should store
it as such.
2023-09-18 12:02:06 +02:00
Mohammad Reza Moradi c38cbbc8dc
fix: apply state event before decryption on leaved room 2023-09-18 11:33:17 +02:00
Nicolas Werner 5b47a647b6
fix: userOwnsEncryptionKeys returns true for empty device lists 2023-09-13 14:26:41 +02:00
Nicolas Werner cce3646339
fix: startDirectChat might return an unjoined room
If you create DM room, but the other party doesn't join it, they might
be unable to create a new DM using startDirectChat. Since creating a new
DM is pretty much the same as joining the invite, we try to join the
pending DM invite first and fall back to creating a new room if that
fails.
2023-09-04 13:27:55 +02:00
mErrenst b17f3a47f2
Merge pull request #1547 from famedly/krille/request-participants-cache
feat: Add option to not cache users in memory when requesting all of …
2023-08-16 09:15:56 +00:00
krille-chan 0c60ad7acd
feat: Add option to not cache users in memory when requesting all of a room 2023-08-13 08:16:11 +02:00
Krille dd64f4702a
fix: Has new messages is never true 2023-08-10 08:44:07 +02:00
The one with the braid 30c27f00a1
fix: direct message room name computation
Signed-off-by: The one with the braid <braid@famedly.com>
2023-08-04 08:17:17 +02:00
Nicolas Werner 4addccd9da
Merge pull request #1534 from famedly/nico/simplify-sorting
refactor: simplify UIA stage selection logic
2023-08-01 08:56:56 +00:00
Nicolas Werner 59693b7375
refactor: simplify UIA stage selection logic
(Also prevents a potential out of bounds exception)
2023-08-01 10:31:55 +02:00
Nicolas Werner b27fd4575d
Merge pull request #1535 from famedly/nico/fix-okb-reset
Make online key backup reset actually backup keys
2023-08-01 08:24:25 +00: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
Nicolas Werner 334c9e3b78
refactor: Simplify room sorting logic to make invite sorting more obvious
It wasn't quite obvious that invites were always sorted at the top, if
you just looked at the sort function. This makes it more explicit and
also makes invites always sort before favourited rooms.
2023-07-31 10:55:27 +02:00
td 66a53786e7
fix: do not proceed call if getUserMedia fails
fix: added a few missing awaits

fix: add a workaround for not having state updates for staleCallChecker till sync

chore: fix some logging
2023-07-10 14:19:16 +05:30
td d042f9e6ae
chore: pass event to redactedAnEvent and removedBy 2023-07-04 17:09:23 +05:30
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 5d8a82aefa
fix: Fixed fake_matrix_api.dart signedOneTimeKeys upload 2023-06-22 18:05:04 +02:00
Malin Errenst f310632a83
fix: Assign correct type to signedOneTimeKeys 2023-06-22 17:18:10 +02:00
Malin Errenst 3bd36aa19f
fix: Fix type cast to fix test in matrix-fhir-dart-sdk 2023-06-22 14:29:29 +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 b90c1b8ca7
fix: Do not display prevContent displayname and avatar for joined users 2023-06-14 12:54:18 +02:00
td e45dbd169d
chore: add qr releated eventTypes 2023-06-13 11:45:27 +05:30
Krille e81898ef7f
refactor: Get rid of dynamic lists 2023-06-13 07:59:20 +02:00
Malin Errenst 06d587e64f
refactor: Changed Map<String, dynamic> to Map<String, Object?>
- contains breaking changes because some type casts will be needed in
  Matrix SDK
2023-06-09 15:04:28 +02:00
Malin Errenst cf984d61f9
chore: generated folder from recent dart_openapi_codegen 2023-06-09 15:04:19 +02:00
Krille d65dc721c3
fix: canRequestHistory should return false if prev_batch is null 2023-06-03 18:03:42 +02:00
td 2ebda5e6fc
chore: fix edited last events breaking db 2023-06-01 23:58:47 +05:30
Krille 85a21a6781
fix: Do not store global profiles in room states as members 2023-05-31 15:01:42 +02:00
Malin Errenst 8cb144aaae Merge branch 'krille/performance-warning' into 'main'
feat: Display performance warning when requesting more than 100 participants

See merge request famedly/company/frontend/famedlysdk!1301
2023-05-30 11:48:51 +00:00
Krille 0f36659ba7
feat: Display performance warning when requesting more than 100 participants 2023-05-30 13:11:38 +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
td c6b6c793d6 Merge branch 'krille/store-last-event-redacted' into 'main'
fix: Also update last event on redaction in store

Closes famedly/company/product-management#990

See merge request famedly/company/frontend/famedlysdk!1298
2023-05-30 06:58:40 +00:00
Reza 153005f4a7
chore: calculate unlocalized body 2023-05-17 08:37:41 +02:00
Krille 8f38006c18
fix: Also update last event on redaction in store 2023-05-16 13:33:57 +02:00
Malin Errenst ac0fdc1deb Merge branch 'td/moreMissingAwaitsbahh' into 'main'
chore: add missing awaits to to_device call events listener

See merge request famedly/company/frontend/famedlysdk!1295
2023-05-15 19:52:03 +00:00
td 26e0d0954d
chore: add missing awaits to to_device call events listener 2023-05-13 20:06:04 +05:30
td 8e4f4486b2
chore: add missing awaits to to_device call events listener 2023-05-13 20:05:09 +05:30
Krille c714574c3f
refactor: Check correct if null
This checks it in a more consistent way
and also makes developing new
databases easier as they
might set the json key but
set it null.
2023-05-11 12:17:53 +02:00
Krille 9c2f026b4d
refactor: Remove unused parameters 2023-05-11 09:24:41 +02:00
Nicolas Werner 47c54cb397
fix: mark DMs as DMs properly when joining
If we join first, it is possible that our member event is not the invite
event anymore. As such we should fetch that state first, before joining.
But also there is little reason not to mark the room as a DM
immediately. That prevents the room from temporarily becoming a group
room, that might be visible in the UI temporarily.

fixes https://gitlab.com/famedly/company/product-management/-/issues/1006
2023-05-09 16:09:01 +02:00
Nicolas Werner 53fbe4f7ef
chore: sort imports 2023-05-08 14:49:34 +02:00
Malin Errenst cc377202da fix: remove deprecated sender_key occurrences 2023-05-08 09:12:14 +00:00
td 36070e23b7
fix: cast issues in getEventList 2023-05-05 19:31:08 +05:30
Krille e170325cae
refactor: Make parameters more clear and remove unused methods 2023-05-05 13:38:56 +02:00
Krille f21260b035
fix: Only request users which are valid mxid 2023-05-04 15:22:44 +02: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
Nicolas Werner a250384eca Merge branch 'td/singleShotSyncBeforeStaleChecker' into 'main'
chore: oneShotSync before staleCallChecker

Closes famedly/company/product-management#658

See merge request famedly/company/frontend/famedlysdk!1284
2023-05-03 06:35:56 +00:00
td 444ba47022
chore: oneShotSync before staleCallChecker
fix: while singleShotStaleCallChecker code seems to be correct we are seeings some random disconnects in group calls, this makes sure we have all the to-device messages we are supposed to have before checking for stale calls
2023-04-29 19:47:13 +05:30
td f240ece32c
fix: updateMuteStatus after kConnected
fix: makes sure any state/race issues we had with sdp packets or cloned streams get fixed automatically
2023-04-29 19:33:34 +05:30
Malin Errenst a0669a505e Merge branch 'krille/set-read-marker-optional-eventid' into 'main'
refactor: Make optional eventId a named parameter

See merge request famedly/company/frontend/famedlysdk!1281
2023-04-28 08:50:26 +00:00
Krille 91617c1892
refactor: Make optional eventId a named parameter
This should not break the
API of consuming apps and
is more intuitive as the
parameter is nullable.
2023-04-28 10:03:04 +02:00
Krille c6f7da12d4
fix: Check the max server file size after shrinking not before 2023-04-28 09:26:54 +02:00
td 1928f292b0
fix: casting of a List<dynamic> to List<String> in getEventList and getEventIdList 2023-04-28 00:55:20 +05:30
Nicolas Werner 831938b8f5
fix: Skip rules with unknown conditions
Without this, when new rules are added with new conditions, we would
always match on them. This would mean all messages now notify. It is
better to skip them instead.
2023-04-26 19:00:24 +02:00
td 046e2caf7d
fix: allow passing a WrappedMediaStream to GroupCall.enter() to use as the local user media stream
currently in the app we start the group call (but do not enter it), then we use the localStreams provided by it to show the setup page (enable/disable media devices). This causes some issues because the user hasn't joined the group call so the member state events don't update and the group call is killed if they just sit on the setup call page. Also creating a group call, sends notifications in our apps but no one has entered it. With this MR, apps can get their own user media, then edit that stream on setup page add it to GroupCall.enter(stream). This way, a group call doesn't have to be started and we get to do the setup page as well.
2023-04-25 14:18:45 +05:30
Nicolas Werner 62b43bef56 Merge branch 'nico/private-receipts' into 'main'
feat: Support private read receipts

See merge request famedly/company/frontend/famedlysdk!1272
2023-04-21 16:37:25 +00:00
Nicolas Werner 663ab11ec5
feat: Support private read receipts
You can either set them to private on the client or overwrite the
behaviour for that on each readMarker call. This also handles incoming
thread receipts and tries its best to figure out what is the latest
receipt. This however breaks the old m.receipt account data event.
2023-04-21 18:31:15 +02:00
Kristian Grønås 101e892cd9
chore: Update image dependency to 4.0.15
Signed-off-by: Kristian Grønås <Kristian.Gronas@student.uib.no>
2023-04-21 06:22:09 +02:00
Nicolas Werner b95edec462
fix: Update the generated enum files 2023-04-17 16:54:43 +02:00
Nicolas Werner 7f519b5619 Merge branch 'main' into 'main'
Implement Thread creating/sending + added neccessary tests

Closes #351

See merge request famedly/company/frontend/famedlysdk!1262
2023-04-17 13:15:36 +00:00
Dmitriy Bragin 203fc25d7a feat: allow sending messages inside threads 2023-04-17 14:39:11 +03:00
Nicolas Werner 7039c33f3a
chore: Upgrade to matrix_api_lite 1.6 2023-04-17 13:23:51 +02:00
Nicolas Werner d99bb05f47
feat: Upgrade to spec 1.6
In theory this is a breaking change, since it changes the read receipt
API slightly.
2023-04-17 11:57:56 +02:00
td 412bd71b23 Merge branch 'td/trySetTrackenabled' into 'main'
fix: update mute status on participants changed.

See merge request famedly/company/frontend/famedlysdk!1263
2023-04-13 14:57:04 +00:00
td 32ba85dc74
chore: stopMediaStream on all streams and make sure dispose runs everytime 2023-04-12 16:36:05 +05:30
td 05ba6368eb
fix: test if setting track enabled on participants changed helps with the media not working randomly issue 2023-04-06 01:18:09 +05:30
Krille 4b1bc435e5
fix: Clear HiveCollection boxes inside of transaction in order
This makes sure that the deleteFromDisk() method is
called AFTER the clear while
the execution order was
random before which could
lead to the problem that
Hive tries to clear a box after
it got deleted.
2023-03-31 13:09:01 +02:00
Malin Errenst da61963d37 Merge branch 'malin/refactorVariableNaming' into 'main'
refactor: Rename one-character-variables in device_keys_list.dart

See merge request famedly/company/frontend/famedlysdk!1259
2023-03-30 13:04:31 +00:00
Malin Errenst d8af3edbe1
refactor: Rename one-character-variables in device_keys_list.dart 2023-03-30 12:30:39 +02:00
Krille c0000c0193 Merge branch 'td/leavedIgnore' into 'main'
chore: ignore stale call checking for archived rooms

See merge request famedly/company/frontend/famedlysdk!1255
2023-03-29 14:12:03 +00:00
td d8d111b1b4
chore: ignore stale call checking for archived rooms 2023-03-29 19:04:10 +05:30
Krille 710752060a
feat: Implement onMigration callback to Client.init() method 2023-03-29 15:30:38 +02:00
Philipp Grieshofer 9aff62a18c feat: Expose a getter for all rooms including archived rooms 2023-03-20 13:12:47 +00:00
Krille efe8e7e5ac
feat: Make possible to overwrite boxcollection opener in Hive Collections Database 2023-03-20 08:01:51 +01:00