Commit Graph

144 Commits

Author SHA1 Message Date
Christian Kußowski c618baae70
refactor: (BREAKING) Make database required 2025-05-16 08:28:08 +02:00
Krille 05f03e00d9
refactor: Remove unused event status roomState 2025-05-08 09:17:10 +02:00
Karthikeyan S 77ec2e0604
feat: ensure direct chats have only 2 members before sending verification requests 2025-03-21 15:54:18 +05:30
Karthikeyan S a3aede19e8
fix: set prev_batch first time from sync response correctly 2025-03-19 17:09:28 +05:30
td f4c6c8d203
fix: set prev_batch when seen in sync 2025-03-17 19:13:48 +01:00
Krille fdbe95ba75
fix: Older state events overwrite newer ones on fetching history 2025-02-11 15:57:33 +01:00
Krille bc328aab5c
refactor: Use Event instead of EventUpdate for storing in db 2025-01-07 14:56:04 +01:00
Krille 2c42c12e72
refactor: Handle Room Account Data outside of Room Event Updates
This also makes sure that
room account data does not
get unnecessarily serialized
and deserialized before
storing it in the database.
For this it changes the
code flow at multiple
places.
2024-12-31 10:58:09 +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 e2f37c2ace
chore: Dispose all clients in test 2024-12-18 11:15:39 +01:00
Krille c58f55c012
chore: Make parse version error less sound 2024-12-17 12:55:56 +01:00
Karthikeyan S 9ded85e786
fix: clear legacy db on logout properly 2024-12-11 07:54:05 +05:30
Krille 29aa28eecf
feat: (BREAKING) Replace onMigration with advanced callback onInitStateChanged
This makes it possible to track
the process of initialization in the
client by just enhancing what
the onMigration callback already
does.
2024-12-09 12:33:15 +01:00
Mohammad Reza Moradi 9c32193dff
chore: add require trailing comma lint 2024-11-07 16:13:37 +01:00
Nicolas Werner ec36d9c8fe
fix: Race conditions in tests now that they are running faster 2024-10-07 21:37:42 +02:00
td 65c0f8119c
fix: actually make sure clientBox has a account 2024-08-28 17:00:14 +02:00
The one with the braid 6e48c308ad
feat: cache .well-known data
- BREAKING: create `DatabaseApi.storeWellKnown` method
- BREAKING: create `DatabaseApi.getWellKnown` method
- add new getter `Client.wellKnown` containing cached `DiscoveryInformation`
- override `Client.homeserver` to invalidate `Client.wellKnown` in case the domain changed
- override `Client.getWellknown` to cache the resolved `DiscoveryInformation`
- add tests for well-known cache

Fixes: #1865

Signed-off-by: The one with the braid <info@braid.business>
2024-08-23 10:01:34 +02:00
Nicolas Werner 3d92428b7e
fix: leave->invite in the same sync would hide the invite
Synapse includes the room in both sections if you have both an
invite->leave and a leave->invite transition in one sync response.
Transitions in the other order are only included once (in the leave
section) it seems, so this should work correctly in all cases.

Fixes https://github.com/famedly/product-management/issues/2283
2024-07-31 19:25:58 +02:00
td 22694a81d8
fix: also delete db on logout
we already cleared it out, but to change the db enc pw on the app we need to delete it completely first
2024-07-26 22:19:02 +05:30
Krille e7802bd20b
fix: Synapse CI job failing because invite state not completely synced 2024-07-23 10:30:40 +02:00
Krille cabf357cf7
refactor: Cache profiles in database and refactor API 2024-07-23 08:51:10 +02:00
td a540bc6ef7
fix: dont override passed powerlevels with groupcall powerlevels 2024-06-11 19:00:39 +05:30
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
td a2e8830df0
chore: expose fake matrix api 2024-04-30 17:42:36 +05:30
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