Commit Graph

42 Commits

Author SHA1 Message Date
OfficialDakari 0fb0a6c47f working on threads 2025-10-22 18:13:59 +05:00
Karthikeyan S 6b73fc6354
refactor: migrate to web and js_interop pkgs 2025-09-26 14:08:01 +02:00
Christian Kußowski c618baae70
refactor: (BREAKING) Make database required 2025-05-16 08:28:08 +02:00
Christian Kußowski c6ff6ebc76
fix: Add missing copy json in updateInboundGroupdSessionAllowedAtIndex method 2025-05-13 10:04:53 +02:00
Krille 5ec745915e
refactor: (BREAKING) Remove hive database and hive dependencies 2025-05-08 14:29:52 +02:00
Krille 3f04532ffe
refactor: Remove BasicRoomEvent type
We actually never use the
roomId of this type and the
matrix spec has changed in
a way that the roomId is
never sent there actually. So
it was super easy to just
replace all BasicRoomEvent
with BasicEvent. The roomId
became nullable anyway.
2025-01-09 11:05:01 +01:00
Karthikeyan S 64030693c9
chore: add transactionId getter to Event class 2025-01-08 23:07:32 +05:30
Krille 50ac4b55b2
fix: No roomId in BasicRoomEvent stores roomaccountdata silently wrong 2025-01-08 15:03:35 +01:00
Krille bc328aab5c
refactor: Use Event instead of EventUpdate for storing in db 2025-01-07 14:56:04 +01:00
Karthikeyan S 83003c86c7
fix: clear cache when clearing DB in MatrixSdkDatabase 2025-01-07 16:36:37 +05:30
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 ce0dfc77ff
fix: Also load room account data in getSingleRoom() 2024-12-30 12:49:14 +01:00
Krille 2d2bbc60cd
refactor: Do not unnecessarily serialize and deserialize json for every account data object
This changes the database
api a little bit so that it does
not unnecessarily serialize
and deserialize all
account data objects. Should
improve the performance of
the SDK.
2024-12-30 12:00:29 +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 ce7838e72a
refactor: BREAKING Store room states as triple keys 2024-12-09 12:36:39 +01:00
Mohammad Reza Moradi 9c32193dff
chore: add require trailing comma lint 2024-11-07 16:13:37 +01: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
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 cabf357cf7
refactor: Cache profiles in database and refactor API 2024-07-23 08:51:10 +02:00
td 73e89966c7
fix: bump database version to v9
clears database to handle any old state seen in history getting applied bug bc336709af
2024-07-18 15:12:42 +05:30
Nicolas Werner bc336709af
fix: state updates being also applied when fetching history
This could sometimes lead to the room name or the names of members in
the room being incorrect.
2024-06-10 14:51:37 +02:00
Krille 4d9b0f6574
fix: Do not return invalid state events from database 2024-05-29 12:07:40 +02:00
Krille f3e631b2eb
fix: Hotfix create missing objectbox 2024-05-21 13:07:36 +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
Krille a1a542d98e
refactor: Create StrippedStateEvents for invite rooms when loading from db 2024-05-06 09:42:05 +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 76a4ce7f67
fix: Make database deleteable without the need to init the boxcollection 2024-03-24 18:02:20 +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 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
Krille 2afd7040a7
fix: Another type error when combining lists 2024-01-12 16:24:00 +01:00
Krille 245cf59205
fix: Type error when combining dynamic lists 2024-01-04 08:30:00 +01:00
Krille 43db98c7b6
fix: Add missing copy map in matrix sdk database 2023-12-27 15:45:44 +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
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
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