Added support for local storage
Initial implementation of local storage
Main Changes:
-
Added support for aDataStore
protocol for persisting Matrix objects to a custom defined object store. API consists of two protocols:DataStore
: A storage protocol which can persist supported types to storage, which supports both async and non-async accessStorable
: Anassociatedtype
indicating the key format used by theDataStore
for object identification.
- Currently supported
DataStore
objects that can be persisted includeSession
,User
,Room
,Credentials
,ClientEvent
,ClientEventWithoutRoomId
. - Implemented a
GRDBDataStore
packageclass for local SQL DB support - Matrix sessions asynchronously serializes itself after every sync response if provided a
DataStore
- Added some unit tests for sanity testing
GRDBDataStore
implementation
Additional Changes:
- Matrix:
-
WellKnown
: AddedEquitable
conformance and public initializer -
NativeImage
: AddedEncodable
and pseudodecodable
conformance (extension/subclassing not really possible for implementing fullCodable
protocol)
-
-
Session
: AddedCodable
conformance -
User
: AddedCodable
conformance -
Room
:- Added
Codable
conformance - Changed
session
,type
, andversion
constant fields to mutable fields
- Added
-
InvitedRoom
: AddedCodable
conformance -
MXC
: Fixed/added encoding implementation - Added type alias for
DeviceId
-
Credentials
:- Updated implementation to match the response from the
/login
API endpoint - Added
Equitable
conformance - Added public initializer
- Updated implementation to match the response from the
-
UnsignedData
:- Extracted
UnsignedData
type as a single type instead of having multiple types with the same implementation (e.g.ClientEvent.UnsignedData
andClientEventWithoutRoomId.UnsignedData
are separate types, although implementation is identical) - Added public initializer
- Extracted
- Added public initializers to all event types
- Fixed
RoomAvatarContent
coding keys
Edited by Michael Hollister