Commit Graph

93 Commits

Author SHA1 Message Date
Doug ac29354b08 Move any visible account settings into AccountSettings. (#6308)
* Remove the now unused setting to disable in-app notifications.

* Move visible account settings into AccountSettings.

Have ignored enableNotifications for now as that will require reworking the NotificationManager.

* Allow different sounds to be selected for each account.

* Move defaultNotificationTone into AccountSettings.
2026-10-13 15:21:13 +01:00
Mauro 60db364436 Introduce a user session manager (#6295) 2026-10-09 14:07:39 +02:00
Doug 93825c01ad Initial implementation of AccountSettings. (#6275)
* Make the UserPreference macro also generate an accessor for the key name.

* Initial implementation of AccountSettings.

- Add an AccountUserDefaults storage with a userID prefix on the key.
- Migrate the 2 values reset by AppSettings.resetSessionSpecificSettings to AccountSettings.

* Rename UserSettings.volatile() to UserSettings.mock()

Given it now has a userID parameter with a default value..
2026-10-06 17:52:24 +01:00
Stefan Ceriu 7973da8251 Throw from session directories and only fatal error when making sense. 2026-09-30 12:24:12 +03:00
Doug 54cc1cba60 Add a new AccountSettings type and compose it with AppSettings into UserSettings.
The new type doesn't contain any settings yet.
2026-09-28 13:04:37 +03:00
Stefan Ceriu b1923b418f Expose the store passphrase as Data instead of a base64 string. 2026-09-23 18:37:42 +03:00
Doug 9c65d36101 Use the ClientFactory pattern everywhere replacing raw ClientBuilders.
# Conflicts:
#	ElementX/Sources/Services/UserSession/UserSessionStore.swift
#	NSE/Sources/NSEUserSession.swift
2026-08-25 16:40:21 +01:00
Mauro Romito 7ecb7f89e6 removed no op line for client builder 2026-08-25 15:04:10 +02:00
Mauro Romito d611bad03b update sdk to 26.08.25 2026-08-25 15:04:10 +02:00
Mauro Romito 748ec818ac remove map tiler url from matrix wellknown 2026-08-05 16:00:43 +02:00
Stefan Ceriu 5851100f07 Expose a global search service from the client
Wrap the SDK's SearchService in a SearchServiceProxy that publishes typed
message results and paginates on demand, expose it on the ClientProxy, and
enable the search index store on the session. Also opens up the timeline item
factory's message content builder so the proxy can reuse it.
2026-07-03 13:39:45 +03:00
Mauro a520d94760 Swift 6 Migration (#5733)
* Enable Swift 6.2 with default main actor isolation for the app target

Turn on SWIFT_VERSION 6.2, SWIFT_APPROACHABLE_CONCURRENCY and SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor for the ElementX target, matching the NSE and Share Extension (which already use 6.2 without the main actor default).

# Conflicts:
#	ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

* Update the code generation templates for Swift 6

Emit nonisolated/@unchecked Sendable mocks and nonisolated string enums, and mark async mock methods @concurrent so they keep suspending like the real implementations (otherwise intermediate states are unobservable in tests). Includes the regenerated mocks and strings.

# Conflicts:
#	ElementX/Sources/Mocks/Generated/GeneratedMocks.swift

* Make the data layer and services nonisolated and Sendable

Annotate the value-type models, Rust SDK proxy wrappers, timeline item graph, settings, logging and NSE-shared types as nonisolated, and conform the service protocols to Sendable so their existentials can cross isolation boundaries. These types run off the main actor and no longer inherit the target's default main actor isolation.

* Adopt the new isolation across call sites, mocks and signatures

Update call sites, closure signatures and mock configuration helpers to match the nonisolated/Sendable data layer, including the main actor isolated mock inits and the @Sendable filter on recentlyVisitedRooms.

^ Conflicts:
^	ElementX/Sources/Services/SecureBackup/SecureBackupController.swift

* Remove redundant @MainActor annotations

With the app target defaulting to main actor isolation, the explicit @MainActor on view models, coordinators, views and their protocols is no longer required.

* Fix concurrency hotspots surfaced by the migration

Resolve the room summary main-thread deadlock by moving diff processing onto AsyncStreams, add the SDKListener.onMainActor FIFO bridge for SDK callbacks, hop KVO/timer/UIKit callbacks to the main actor via assumeIsolated, add isolated deinits, and apply the few justified nonisolated(unsafe) escapes for queue-confined Apple APIs.

* Fix the unit tests for Swift 6 concurrency

Hop the waitForConfirmation body onto the caller's actor (Swift Testing runs confirmation closures off-actor), and adjust the affected suites and async signatures.

* offload diffs on concurrent threads instead of main actor

* make room info protocols sendable

* use a task group for fetching data so that everything runs concurrently in the TextRoomTimelineView when getting the preview.

* use the generic onMainActor implementation, which already makes a stream and send the continuation on the main actor.

* small pr comments issues being addressed

* update enterprise

* Update StaticCode to 1.1.0 and specify the required Swift isolation.

* fix ElementCallServiceTests

* update enterprise

* re-generate mocks

* update enterprise

* enterprise new code conformed to swift 6

---------

Co-authored-by: Doug <douglase@element.io>
2026-06-18 17:55:31 +02:00
Mauro 7093d966b4 Set map tiler URL from well known if available (#5633) 2026-05-28 15:24:58 +02:00
Doug fa67713726 Run SwiftFormat. 2026-05-27 17:11:42 +01:00
Michael 5a07c98afc Make AnalyticsService mockable via `AnalyticsServiceProtocol (#5599)
* Create AnalyticsServiceProtocol and conform AnalyticsService

* Replace AnalyticsService properties and arguments with AnalyticsServiceProtocol

* Inline AnalyticsServiceMock replacing old mock

* handle more complex AnalyticsServiceMock callsites

* move documentation from AnalyticsService to AnalyticsServiceProtocol
2026-05-20 08:23:58 +03:00
Richard van der Hoff 9a2a852af3 Promote "history sharing on invite" out of developer options (#5480)
* Enable key-share-on-invite irrespective of feature flag

* Remove feature-flag dep: warning on starting chat with new people

* Remove feature-flag dep: invite from room member details

* Remove feature-flag dep: warning on new users in invite screen

* Remove feature-flag dep: from room details screen

* Remove feature-flag dep: starting chat from user profile screen

* Remove feature-flag dep: timeline info on forwarded keys

* Remove feature-flag dep: RoomScreenModel

* Remove `enableKeyShareOnInvite` from AppSettings

* Remove `enableKeyShareOnInvite` feature flag

* Remove outdated comments

* Update preview test room snapshots as their header now includes the history sharing icon
2026-04-27 14:43:18 +03:00
Mauro Romito b31d0cad75 implemented the LiveLocationManager as part of the user session and setup of permissions in the plist. 2026-03-31 12:58:27 +02:00
Stefan Ceriu a2a8527ffc Clean up the Signposter implementation and align on new metrics 2026-01-30 13:19:05 +02:00
Stefan Ceriu 23062901c0 Update files following swiftformat upgrade 2026-01-27 12:50:57 +02:00
Milton Moura b4268e0a88 fix: remove unused Kingfisher import
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
2025-12-13 10:11:57 +02:00
Doug 022bc76c52 Add @MainActor to some of the hook points. 2025-11-18 16:25:11 +02:00
Doug 419c18cabb Fix a potential bug where the token couldn't be refreshed when the cached server /versions had expired. (#4687)
* Update SDK mocks for UniFFI 0.30.0

* Update the SDK.

* Update the SDK again

Includes a temporary workaround that patches the SDK's generated Swift files so that our tests don't crash:
https://github.com/element-hq/matrix-rust-components-swift/commit/3f0075fb8acaf202755512dfbafc28024e5125b2
2025-11-03 19:09:31 +00:00
Mauro f7dd9cdcf8 Update copyright holding and dates (#4640)
* Update copyright holding and dates

* compound IDE Macros updated

* update copyright

* update copyrights done

* update templates and README
2025-10-21 14:34:56 +02:00
Doug 2f2e6f6226 Revert weak media provider (#4483)
* Revert "Address the real lifetime issue of the SDK's `Client` by making `Context.mediaProvider` weak. (#4466)"

This reverts commit c794144ef1.

* Better docs.
2025-09-08 17:48:58 +01:00
Doug 90504d89c8 Use the SDK's offline detection everywhere (except for restarting the sync loop). (#4472)
* Use the SDK's offline state to drive the offline indicator.

* Only use network reachability for restarting the sync loop, use the homeserver reachability for requests.

* Add a separate indicator to distinguish when the server is unreachable but the device is online.
2025-09-08 12:18:02 +00:00
Doug c794144ef1 Address the real lifetime issue of the SDK's Client by making Context.mediaProvider weak. (#4466)
This reverts commit 927aea4bfe.
2025-09-05 17:18:14 +00:00
Doug 927aea4bfe Workaround: Hold a weak reference to the SDK's Client in MediaLoader so it can be released when clearing the cache. 2025-09-03 17:39:16 +01:00
Doug e182940844 Handle TimelineDiff as an enum with associated values. (#4379)
* Handle TimelineDiff as a true enum.

* Update the SDK.

* Silence some warnings.
2025-08-05 09:23:22 +01:00
Doug 5242e7fb6c Drop support for the legacy session directory and optional store encryption.
Store encryption became mandatory in #2692
Rust's sessionPath replaced the legacy session directory in #2903
Native sliding sync migration resulted in new restoration tokens for new users in #3071 and later for all users by #3801.
2025-07-30 14:42:59 +01:00
Doug 5762e1c537 Stop showing the sliding sync proxy alert to any remaining users.
The session will simply fail to restore and the restoration token deleted.
2025-07-30 14:42:59 +01:00
Doug 5e165be8c3 Make the remote settings hook usable within the app extensions. (#4342) 2025-07-22 17:09:53 +01:00
Stefan Ceriu 6a4a1b134b Add support for the new client wide threads feature flag
- enable it everywhere as it's safer than dealing with different configurations
2025-07-04 16:04:46 +03:00
Richard van der Hoff 394eb008ab Add a developer option for history sharing on invite
Adds a new developer flag, enabling our experimental support for MSC4268.
2025-06-11 11:24:29 +03:00
Stefan Ceriu 5500cc2335 Remove the event cache feature flag, it's enabled by default on the SDK and we haven't had any bug reports for it. 2025-04-03 18:08:34 +03:00
Stefan Ceriu 62636d8378 Bump the RustSDK to v25.04.02 2025-04-03 18:08:34 +03:00
Mauro Romito 7373eabffb refactored the ClientProxy to:
- throw an error during the init
- to have its init directly instantiate the sync service and the providers

Update ElementX/Sources/Services/UserSession/UserSessionStore.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

renamed
2025-03-06 14:13:55 +01:00
Stefan Ceriu 4d34a1ed56 Bump the RustSDK to v25.03.05
- adopt the new timeline configuration which now exposes read receipts tracking. For now it should be set to `false` for all timelines except the live one, which still gets configured properly on the rust side through `init_timeline`. Eventually we will converge on this configuration API for all of them.
- also adopt the new rust side cache clearing method and remove our own
2025-03-05 14:24:44 +02:00
Doug 8c07ee35c4 Update the SDK.
Handles changes that removed support for the sliding sync proxy.
2025-02-18 11:55:20 +00:00
manuroe 3950cac085 Dual licensing: AGPL + Element Commercial (#3657)
* New LICENSE-COMMERCIAL file

* Apply dual licenses: AGPL + Element Commercial to file headers

* Update README with dual licensing
2025-01-06 11:27:37 +01:00
Stefan Ceriu df3e5976ce Bump the RustSDK to v1.0.79; add a feature flag for the new rust side ClientBuilder::useEventCachePersistentStorage 2024-12-10 18:19:31 +02:00
Stefan Ceriu 3a600a94d5 Fix #1947 - Check expected files are still present before restoring a session. 2024-11-12 15:50:51 +02:00
Valere 23ab453a1e crypto: rename invisible crypto flag to deviceIsolationMode (#3331) 2024-09-26 12:24:46 +01:00
Doug a8dbda90d9 Configure the AuthenticationService later now that we have 2 flows on the start screen. (#3316)
* Don't query the homeserver until confirming it (or selecting a different one).

* Setup the infrastructure to test AuthenticationService.

Implement basic tests for configuration & password login.

* Use the real AuthenticationService with a mock Client in all of the tests.

* Add tests for the ServerConfirmationScreenViewModel.

* Remove redundant view state and test for it.
2024-09-25 14:40:18 +01:00
Valere 69009a899a Fix: confusion of lab flags for invisible crypto (#3319) 2024-09-23 16:43:02 +01:00
Valere f7d878bac6 crypto: Add configuration flag to enable invisible crypto (#3247) 2024-09-18 16:30:45 +01:00
Stefan Ceriu 16d3cb6f3f Log where the user's state and caches folders were setup on startup. 2024-09-13 15:25:17 +03:00
Doug af3a6ccbed Make the SessionDirectories type responsible for cleaning up data. (#3261) 2024-09-11 14:32:03 +01:00
Stefan Ceriu 664e87fe87 Switch license to AGPL (#3237)
* Switch license file to AGPL

* Update file copyright headers

* Update the default project file header
2024-09-06 16:34:30 +03:00
Doug c9603dce55 Adopt sliding sync versions for client Restoration. 2024-08-30 14:45:54 +03:00
Doug 812c5d5c61 Update the SDK (#3196)
* Update the SDK.

* Fix API breaks on send failures and propagate the new type.

* Handle new SDK ShieldState.

* Set up the ClientBuilder's `cachePath` option.

* Delete the cacheDirectory during logout/clearCache.

* Add unit tests for RestorationToken decoding and SessionDirectories generation.
2024-08-27 11:06:26 +01:00