27 Commits

Author SHA1 Message Date
Doug f05fd41c36 Replace the UserPreference property wrapper with the new macro version. 2026-06-29 10:34:32 +01: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 da5360c8e8 Hide user dot and track own user marker in Live Location mode. (#5707)
* added a new tracking mode for following a marker and the logic for switching such tracking mode

* implemented the follow marker tracking mode

* improved and added new tests
2026-06-05 13:51:57 +02:00
Doug fa67713726 Run SwiftFormat. 2026-05-27 17:11:42 +01:00
Mauro 76f744b9c4 Live Location Sharing - handle server echoes (#5514)
* Track active live location sessions by ID instead of timeout.

# Conflicts:
#	ElementX/Sources/Services/Location/LiveLocationManager.swift

* implemented a system to promote starting session to active sesessions to send locations at the right time, and a system to remove a local session if it's handled by an external device.

* pr suggestions

---------

Co-authored-by: Doug <douglase@element.io>
2026-04-30 13:18:36 +00:00
Doug 2cee290827 Replace ​Combine throttle with backpressure​-aware location send loop. 2026-04-28 18:02:22 +02:00
Mauro Romito 876109ef75 removed LLS feature flag 2026-04-27 15:13:07 +02:00
Stefan Ceriu 31dbc6bd6c Fix orphaned doc comment warning 2026-04-24 16:44:00 +03:00
Mauro 5d1132c75b Update SDK to 26.04.23 (#5478)
updated sdk, and added error management on the send LLS API
2026-04-24 13:07:16 +02:00
Mauro Romito b0fa1afe51 Force a stop before starting a new session and resend last location on new starts 2026-04-23 17:53:17 +02:00
Mauro Romito 6dc6eed9e3 stop showing live location disclaimer when accepted. 2026-04-22 18:17:17 +02:00
Mauro Romito ad2143f334 use current value subject and current value publisher for LiveLocationShare updates 2026-04-22 16:43:18 +02:00
Mauro 55f82e69b1 Improve Live Location Sharing with reduced accuracy mode (#5461) 2026-04-22 13:12:03 +02:00
Mauro Romito 2250087cfe handle reduced accuracy authorization case 2026-04-21 13:51:40 +02:00
Mauro Romito 30ee9c943a updated the UI for the live locations distance to match designs. 2026-04-21 12:32:50 +02:00
Mauro Romito 53f6c66a8b use CLLocationManager directly to handle location updates since is more reliable in bg and more configurable 2026-04-21 12:32:50 +02:00
Mauro Romito 676c90c484 allow users to set live location minimum distance update 2026-04-21 12:32:50 +02:00
Mauro Romito 22e3c81da1 implemented a 3 seconds throttling of LLS updates. 2026-04-21 12:32:50 +02:00
Mauro bfb1036aa0 LLS Sheet implementation (#5420)
* Add LiveLocationSheet and refactor existing views to share code

* Implement logic for highlighting a specific LLS from a user once selected in the sheet

* Updated tests, project and added new previews for the LLS sheet.

# Conflicts:
#	PreviewTests/Sources/__Snapshots__/PreviewTests/liveLocationRoomTimelineView.Bubbles-iPad-pseudo.png
#	PreviewTests/Sources/__Snapshots__/PreviewTests/liveLocationRoomTimelineView.Bubbles-iPhone-pseudo.png

* add Equatable conformance to CLLocationCoordinate2D
2026-04-17 11:13:16 +00:00
Mauro Romito a40fab5f5e pr suggestions 2026-04-14 14:17:27 +02:00
Mauro Romito facba008e7 implement APIs for LLS observation 2026-04-14 14:17:27 +02:00
Mauro 8bfdc70b9c Fix LiveLocationManager flaky tests (#5389) 2026-04-13 18:05:47 +02:00
Mauro 922fcafcd5 Live Location Sharing Banner (#5370)
* Live Location Sharing Banner

# Conflicts:
#	ElementX.xcodeproj/project.pbxproj

* updated the top banner modifier and the top banner views

# Conflicts:
#	ElementX/Resources/Localizations/en-US.lproj/Localizable.strings
#	ElementX/Resources/Localizations/en.lproj/Localizable.strings

* improved the stopping function from the timeline item

* stop live location sharing before starting a new one.

* added some tests for LiveLocationManager

* pr suggestions
2026-04-10 14:50:42 +02:00
Mauro Romito d9a480b1c6 pr suggestions 2026-04-03 12:36:45 +02:00
Mauro Romito df5570281b implement the start, send and stop functions 2026-04-03 12:36:45 +02:00
Mauro Romito a1029132c5 PR Suggestions 2026-03-31 12:58:27 +02: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