Commit Graph

120 Commits

Author SHA1 Message Date
td 281510b950
feat: lcov and tag olm tests 2024-04-23 15:21:46 +05:30
Krille e266ef7312
refactor: Switch to MatrixSdkDatabase as suggested database and deprecate other ones 2024-03-22 16:05:08 +01:00
krille-chan 20073ddd49
refactor: Store lastEvent in room object instead of room state 2024-03-18 13:18:36 +01:00
Nicolas Werner 69fe7845a9
chore: Add regression test for invite->join state handling
This is a reduced test case which made me investigate the issue and is
fixed by the previous few commits.
2024-03-04 17:58:39 +01:00
Krille 38b1eb75e5
feat: Implement handling soft logout 2024-02-23 13:06:38 +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
td b6d5ce02c4
feat: add tests for calls 2023-12-19 21:55:30 +05:30
Krille 06669cbcac
refactor: Store fetched presence in db and deprecate own cache 2023-11-27 15:48:21 +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
td 1ab06cb01a
fix: clear local database on logout even if server timesout 2023-11-13 18:12:47 +05:30
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
Nicolas Werner 7039c33f3a
chore: Upgrade to matrix_api_lite 1.6 2023-04-17 13:23:51 +02:00
Philipp Grieshofer 9aff62a18c feat: Expose a getter for all rooms including archived rooms 2023-03-20 13:12:47 +00:00
Nicolas Werner 8c096ef6ca
test: Add tests for account data store and retrieve
fixes https://gitlab.com/famedly/company/frontend/famedlysdk/-/issues/326
2022-12-21 19:49:59 +01:00
Nicolas Werner 6555f36d6d feat: switch from pedantic to lints 2022-08-15 14:15:51 +00:00
Henri Carnot 2a019eaec3 feat: keep timeline history for archive rooms in memory 2022-07-21 14:14:17 +00:00
td f04d8a9f40 Merge branch 'krille/import-sorter' into 'main'
refactor: Use import sorter and ci templates

See merge request famedly/company/frontend/famedlysdk!1079
2022-07-21 13:59:05 +00:00
Christian Pauly 7885281c72 refactor: Use import sorter and ci templates 2022-07-21 15:44:04 +02:00
Nicolas Werner d5fd03d52d fix: (potentially) a race in the archive test 2022-07-19 14:13:55 +02:00
Nicolas Werner 6e211f5a81 fix: race conditions in the SDK and its tests 2022-07-13 00:36:49 +00:00
Christian Pauly 9628095ac9 feat: Implement CachedStreamController
This makes it possible to access the last
value of a stream at any time.
2022-06-30 09:22:53 +02:00
Christian Pauly a1c6bc7551 refactor: Let _handleRoomEvents use BasicEvent
This is the first step to reduce
the use of pure json in the
sync method.
2022-06-28 14:09:12 +02:00
Christian Pauly 58cfd1f688 refactor: Rename methods and get rid of all Future getter 2022-06-08 08:30:05 +02:00
Henri Carnot fb18843b08 refactor: make sender getter async 2022-06-02 08:13:21 +00:00
Krille Fear 3f3d4d38d6 refactor: Migrate to Matrix Api Lite 1.0.0 2022-05-17 22:50:04 +00:00
Henri Carnot ff586b06b1 fix: don't assume element is a string 2022-05-17 09:25:13 +00:00
Nicolas Werner 907a0d2317 feat: Store timestamp in the presence events
This fixes the presence never being accurate in the app.
2022-05-06 13:04:31 +02:00
Lanna Michalke ecdbb06118 feat: introduce new MSC library architecture
- migrated to more useful MSC directory structure
- migrate Widgets API into new structure
- add recent emoji API into new structure

The recent emoji API is non-standard and should be compatible with Element.

Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
2022-05-03 09:17:57 +02:00
Christian Pauly eefc40e2d0 refactor: Get rid of dynamic input in checkHomeserver
This also fixes the automatic
homeserver detection in the
login method. It no longer uses
the deprecated user.
2022-04-21 15:40:21 +02:00
Christian Pauly 5973e629fe feat: Get event from push notification 2022-04-14 17:01:05 +02:00
Nicolas Werner 83298cc98b fix: own profile containing mxid
There are a few ways to fix this. We could skip events, where we don't
have the state in memory yet or always do a /profile request and cache
that.

I chose to go with loading the event from the database if necessary. If
we have a room in the db, we should have our memberevent in the db. In
some cases we might not (if the server thinks our memberevent is super
redundant), but I think the spec doesn't really allow that and it
doesn't happen in practice. And even if it would, we probably would want
our member event ASAP. And if we have no rooms, we fetch it from the
server as before instead of constructing a member with an MXID as the
username.

fixes https://gitlab.com/famedly/company/frontend/frontend-issue-inbox/-/issues/65
2022-03-15 02:13:09 +01:00
Krille Fear b472dd7b92 fix: Room Member updates should always be cached
I think the commit which broke it was this: e3bd0cf1 It makes sure that only important state events get cached and room member events are not important state events and so new invites have no room member events cached. It makes sense to also allow room member events here to always be cached as they are special typed.
2022-01-08 10:44:22 +01:00
Krille Fear 3bce8b4489 refactor: Remove unnecessary type checks and imports 2021-12-23 11:46:45 +01:00
Sorunome b009ada0ac
fix: Allow consecutive edits for state events in-memory
The lastEvent was incorrect when trying to process an edit of an edit.
This fixes that by allowing consecutive edits for the last event.
2021-12-06 11:11:21 +01:00
Sorunome e3bd0cf139
fix: Only save state events from sync processing in-memory if needed
If we dump all state events from sync into memory then we needlessly
clog up our memory, potentially running out of ram. This is useless
as when opening the timeline we post-load the unimportant state events
anyways. So, this PR makes sure that only the state events of post-loaded
rooms and important state events land in-memory when processing a sync
request.
2021-12-06 11:09:50 +01:00
Krille Fear 4cf88e2be6 feat: More advanced create chat methods
This includes a new simplified
API to create new direct and
group chats. It also handles
enabling encryption by
default.
2021-11-09 15:39:42 +01:00
Nicolas Werner 6e20c53b01
refactor: remove redundant null checks 2021-10-28 14:32:09 +02:00
Nicolas Werner 32c6e0ec6e
refactor: port client and related tests to nullsafety 2021-10-28 03:44:02 +02:00
Nicolas Werner fb0a84d7b2
refactor: make client nullsafe 2021-10-25 16:34:02 +02:00
Christian Pauly 00771fc209 refactor: _updateUserDeviceKeys method 2021-09-13 14:58:07 +02:00
Christian Pauly e13b00d127 refactor: Make RoomUpdate class null safe by removing it
RoomUpdate came from a time where we had no data model for
SyncUpdates but now we have and therefore this class is just
code duplication. This removes the class
and uses the SyncRoomUpdate class from
the package matrix_api_lite instead.
It needed a lot of refactoring at some places
where I also have removed some unnecessary null or type checks.
2021-09-08 12:31:55 +00:00
Sorunome ffb6fd426c
fix: Requesting history being funky
As it turns out, some of the code set the prev_batch for rooms too
early to an empty string. For synapse this means "request from the start",
for conduit it is just an error. This commit fixes that by never resolving
null --> empty string, but instead throw an error.
2021-08-29 12:56:16 +02:00
Christian Pauly 2f35277e47 refactor: Change name of archive getter to function
This is more intuitive because it is
a function that loads something from
the server and doesnt directly return
something.
2021-08-25 10:36:58 +02:00
Lukas Lihotzki 9087f08775 chore: mxc url in Uri 2021-08-23 11:05:47 +02:00
Christian Pauly 9b7474e2f2 refactor: Update to dart 2.12 and opt out in all files
This also adds some missing license headers, I have detected while
using license header search&replace to add the
null safety opt out
2021-08-18 08:09:39 +02:00
Jindřich Pikora cf441e533d refactor: rename LoginState.logged to loggedIn 2021-08-03 12:26:17 +00:00
Lukas Lihotzki 8665f092f4 chore: matrix_api_lite 0.4.0 2021-07-26 14:54:22 +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
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 c0c7f68bf3 chore: Rename to matrix 2021-06-18 09:58:25 +02:00