Commit Graph

978 Commits

Author SHA1 Message Date
Stefan Ceriu e7787f4c3f Set the room list mode synchronously on a warm launch
The room summary provider subscription only delivers its current state through an
async main queue hop, which can end up queued behind the first render. On a warm
launch, where the cached rooms have already been published before the home screen
exists, that leaves the skeletons up for the whole duration.

Read the current state at the end of init instead, alongside the rooms which were
already being read there.
2026-08-21 12:26:02 +03:00
Stefan Ceriu 8c9edd5ea9 Fix the room list flashing empty on launch
The room summary provider publishes its loading state and its rooms through two
independent streams, so the state can report loaded before the first summaries
have been applied. Flipping the room list mode to .rooms at that point renders
an empty list until the summaries arrive.

Combine the two publishers into a single subscription so that the mode and the
rooms are always updated from the same pair of values, and keep the skeletons up
until the rooms have published. Only the initial transition is held back, an
empty list later on is a filter or a search result and must not send the mode
back to the skeletons.
2026-08-21 12:26:02 +03:00
Stefan Ceriu 5f49c25952 Fix wrong media duration assertions and invalid tolerances 2026-08-19 07:41:26 +03:00
Stefan Ceriu 804fccf650 Reduce the size of the portrait test video 2026-08-19 07:41:26 +03:00
Stefan Ceriu f3c8438bd8 Add send alert tests 2026-08-18 11:55:32 +03:00
Stefan Ceriu f7f55024ab Fix the flaky ElementCallServiceTests by replacing TestClock
The suite intermittently hung on CI, most recently for the full 2 minute time
limit on lifetimeIsCapped(). A spindump from a failed run shows the process
suspended rather than spinning (0.247s of CPU over 190s) with a background
priority worker thread sitting runnable for roughly 145 seconds without ever
being scheduled.

That band is exactly what swift-clocks' TestClock depends on to make progress:
both advance() and checkSuspension() await Task.megaYield(), which serially
awaits 20 detached tasks at background priority. On an oversubscribed runner
those never run, so the test waits forever instead of failing. The same
mechanism, less starved, is why two of the passing tests took 1.0s and 0.77s
for what is otherwise pure logic. checkSuspension() made it worse, since
asking whether a timer was armed cost a megaYield per poll.

ManualClock replaces it. It holds a single pending sleep, since that is all a
test needs to step through: the sleep registers a continuation, advance(by:)
resumes it synchronously once its deadline passes, and waitForScheduledSleep()
suspends until the timer is armed instead of polling for it. Nothing in the
path touches background priority and no loop's iteration count depends on the
scheduler. The suite now runs in 0.019s, and under a locally saturated CPU the
old version took 1.005s against the new one's 0.037s.

Also drops the now unused Clocks package, removes the 2 minute time limit that
was papering over the starvation, re-enables callIsTimingOut() which the same
flakiness had disabled, and has lifetimeIsCapped() assert the 90 second cap
directly rather than inferring it from when the timer fires.
2026-08-14 16:16:53 +03:00
Stefan Ceriu d4d74dd8f8 Avoid race conditions between the home screen's crash alert and Sentry's onLastRunStatusDetermined
By converting the `lastCrashEventID` to a publisher that the VM can just listen to instead of relying on start to match a pre-set event
2026-08-13 16:17:21 +03:00
Stefan Ceriu 37c78bf6b1 Add a test covering the map framework being loadable
The shim is embedded but not linked, so nothing at build time proves it is
still there. If it stops being copied into the bundle, or the class is renamed,
dlopen simply fails at runtime and the user gets a blank map behind an error
alert. Nothing in CI would notice.

The test asserts the framework loads and the shim resolves, which is exactly
the pair that breaks if either side of the arrangement is disturbed.
2026-08-12 15:04:24 +03:00
Michael 6efa8743ff Combine the Server Selection screen into the Server Confirmation screen and add autocompletion when entering an account provider. (#5949)
* Adjust login flow to exclusively use the ServerSelectionScreen

* Move async code to server selection vm

* ServerSelection supports pro picker options

* Use homeserver address for both confirmation and picker modes

* rename ServerSelectionScreenMode

* remove ServerConfirmationScreen

It's been superseded by the ServerSelectionScreen

* rename userInput

* Update strings with latest design strings

* Add server input autocompletion

* Store previous servers in AppSettings and autofill on server signin

* Audit changes for logging

* Enforce lowercase server history storage

* Update tests

* Update Xcode project

* PR review fixups

* Add HomeserverHistoryManager

* Review fixups 2

* Review fixups 3
2026-08-10 18:38:37 +01:00
Doug aeffd942ec Update the SDK with a fix for read receipts. (#5991) 2026-08-07 13:41:48 +01:00
Danny 1a72a4e17b Allow tapping the avatar in the room member bottom sheet to view it fullscreen (#5989)
* Extract a shared helper for loading a media preview

The four screens that show a fullscreen avatar each had their own copy of the same
load-and-wrap logic. Move it to MediaPreviewItem.load, with the mime type as a
parameter defaulting to JPEG, and leave each screen's loading indicator where it is.

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>

* Only dismiss a QuickLook preview that is still presented

UIKit forwards dismiss() up the presentation chain when the receiver has nothing
presented, so dismissing the avatar view was dismissing the profile details sheet
also.

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>

* Allow tapping the avatar in the room member bottom sheet to view it fullscreen

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>

---------

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
2026-08-07 13:11:40 +01:00
Doug a82726a991 Add timeouts after verifying the device owner when linking a new device. (#5970)
* Support for waitingForAuth continuation sender during Link new device

* Stop automatically regenerating new QR codes when they expire.

This reverts part of commit e235e3ba81.

* Add a timeout after the Face/TouchID verification when linking a desktop computer.

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2026-08-06 14:56:34 +01:00
Doug f422208399 Update the SDK and handle some API breaks. (#5986) 2026-08-06 10:54:10 +01:00
Mauro Romito 748ec818ac remove map tiler url from matrix wellknown 2026-08-05 16:00:43 +02:00
Doug 80530f0006 Add hooks for the RoomDetails, RoomMemberDetails and UserProfile screens. (#5980)
Also adds an @AppHook macro.
2026-08-05 12:41:18 +01:00
Doug 1e78825b0b Rename properties and sort members in advance. 2026-08-03 15:00:38 +01:00
Kai 3ab0aacabf Add call icon next to members in call (#5941)
* feat: add call icon next to members in call

* feat: use matrix rtc room status for in-call

* chore: revert xcodeproj change

* chore: update preview tests

* chore: Update ElementX.xcscheme

* chore: undo room member status proxy

---------

Co-authored-by: Kai <nankeen@users.noreply.github.com>
2026-08-03 15:00:38 +01:00
Doug 94cd9590b5 Allow clearing your own call status. (#5959)
* Allow clearing your own call status.

* Clarify the names of the SettingsScreenUserStatusRow.Mode cases.
2026-07-31 18:15:42 +01:00
Mauro Romito b044764310 unified the filtering of the gallery items 2026-07-31 15:14:39 +02:00
Mauro Romito 68a277143a use the appropriate timeline kind (to be refactored) 2026-07-31 15:14:39 +02:00
Mauro ae795df530 Allow previews in the timeline to include filtered galleries (#5943)
* remove the usage of the timeline kind override in favour of getting it properly from the timeline view model

* allow the previews to include gallery items filtered by the allowed types when started outside the gallery

sss

asa

* fix for actions not being forwarded to the timeline right

* pr suggestions
2026-07-30 13:49:22 +02:00
Mauro Romito 58fb7c4fcb Wait on durable state in three flaky test suites
These three suites assert against state that is still being loaded or has
already moved on, so they fail whenever a busy runner stretches the window.
All three passed on CI only because `-retry-tests-on-failure` re-ran them.

- MediaUploadPreviewScreenViewModelTests: the processing failure tests treated
  a one second `deferFailure` window as if it also meant the send had finished.
  Preprocessing the valid files outlasts it, so wait for the interaction to be
  re-enabled instead.
- SecurityAndPrivacyScreenViewModelTests: the screen loads its parent spaces and
  its room directory visibility in two independent tasks, and `isSaveDisabled`
  needs both. Every wait now gates on the visibility having landed too.
- RoomNotificationSettingsScreenViewModelTests: the delete tests waited on a
  transient `deletingCustomSetting` flag that the observation coalesces away
  under load. They now wait on the dismiss action and the alert.
2026-07-29 11:53:17 +02:00
Mauro Romito 7ea9aeb174 Open a full-screen preview when tapping a gallery item
Tapping a gallery tile/row opens the existing media preview scoped to that gallery's attachments, paging between them. Introduces a typed MediaPreviewItemID (replacing the stringly-typed preview identifier) and a gallery-scoped TimelineMediaPreviewDataSource; the tap routes through TimelineInteractionHandler/TimelineViewModel. Non-previewable (.other) items are skipped without shifting the tapped index.

Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>

just use id instead of previewID

removed horrible multiline ternary

pr suggestions

remove redundant code

remove empty caption display + gallery uses the appropriate media timeline actions
2026-07-28 16:49:08 +02:00
Doug 8c56ecbd04 Add an oAuthClientURIPath option to AppSettings. (#5934)
Left unset until our URL is confirmed.
2026-07-28 09:22:22 +01:00
Matthew Hodgson a8c79fdd46 Implements push notifications for LLS via MSC4505 (#5872)
* Render live location share start push notifications in the NSE

Live location sharing starts with a cleartext org.matrix.msc3672.beacon_info
STATE event, which the NSE previously rendered as the generic fallback
notification because NotificationContentBuilder only handled message-like
event content.

- Handle .state(.beaconInfo) in NotificationContentBuilder: sender display
  name as the title (same as other messages) with a new localized body,
  "Started sharing their live location".
- Let beaconInfo state events through NotificationHandler's preprocessing
  (all other state events are still discarded).
- Add notification_live_location_started_body, imported from Localazy.
- Unit tests for the new state-event notification paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* rename processMessageLike in processAsMessage

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Mauro Romito <mauro.romito@element.io>
2026-07-27 16:31:47 +02:00
Doug d4849a2a79 Remove the requiresExtraAccountSetup badge. (#5921)
It is no longer part of the designs, we only badge the item in Settings.
2026-07-23 09:06:25 +01:00
Doug bf498a5d18 Small tweaks to the Presence feature. (#5918) 2026-07-23 08:40:48 +01:00
Mauro 6967f99626 Content scanner also checks for thumbnails (#5911)
* scan also thumbnails for medias

* pr suggestion
2026-07-22 16:43:08 +02:00
Jared L cff46137b9 Report user presence on app lifecycle transitions (#5838)
* Report user presence on app lifecycle transitions

Adds a PresenceReporter driven by the app lifecycle handlers and the sharePresence setting: online when foreground-active and sharing, unavailable when backgrounded and sharing, offline when not sharing. Sends are immediate, deduped, and serialized latest-wins. Background app refresh and the NSE seed the process presence to offline so their sync requests carry no presence side effect. Presence rides on the SDK's process-global state, so every sync path is covered without touching sync lifecycle.

Signed-off-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Add presence reporter tests

Pins the presence reporter invariants: the never-online sweep with sharing off, an immediate online send on foreground-active, dedupe of repeated states, latest-wins ordering of serialized sends, and the NSE offline seed.

Signed-off-by: Jared L <48422312+lhjt@users.noreply.github.com>

* wip: address review comments

Signed-off-by: Jared L <48422312+lhjt@users.noreply.github.com>

* refactor: remove obsolete presence heartbeat

Remove the shared activity snapshot, heartbeat refresh, and notification-extension freshness policy while retaining the session-scoped presence service and its serialized lifecycle reporting. Restore the NSE's intermediate one-time offline seed so the cleanup remains buildable ahead of the final sync-presence correction.

Signed-off-by: Jared L <48422312+lhjt@users.noreply.github.com>

* fix: make notification extension presence-neutral

Configure the built NSE client with offline sync presence without sending an immediate presence update. Keep notification setup non-fatal when presence configuration fails and remove the temporary production test seam.

Signed-off-by: Jared L <48422312+lhjt@users.noreply.github.com>

* chore: restore application lifecycle logging

Restore the pre-existing foreground lifecycle diagnostics that were removed during the presence refactor. Keep presence reporting session-scoped and clarify that background refresh configures the client's sync presence without an immediate update.

Signed-off-by: Jared L <48422312+lhjt@users.noreply.github.com>

---------

Signed-off-by: Jared L <48422312+lhjt@users.noreply.github.com>
2026-07-22 15:23:36 +01:00
Stefan Ceriu 6f8c5a0e76 Add more search screen tests 2026-07-22 15:40:56 +03:00
Stefan Ceriu 4eb0863f3a Surface search set query errors with an error indicator 2026-07-22 15:40:56 +03:00
Doug 32a54c5b71 Hook up the emoji picker to the custom status row. (#5902)
* Refactor EmojiPickerScreen to take a continuation instead of a timeline/itemID.

* Hook up the emoji picker to the custom status row.
2026-07-22 13:35:37 +01:00
Mauro b5b28b9986 Support sending gallery messages behind a feature flag (#5909)
dds sending of multi-media "gallery" messages, gated behind the new galleryEnabled developer option (Developer Options → Room, off by default). Rendering of received galleries ships in a separate PR.

Wires sendGallery through TimelineProxy/TimelineController onto the SDK's Timeline.sendGallery.
MediaUploadPreviewScreen sends selected items as one gallery when the flag is on.
Co-authored with the original author of #5601.

NOTE: This PR allows to send gallery messages, but they won't be rendered without the gallery timeline item PR.
2026-07-21 17:25:30 +02:00
Stefan Ceriu ea6475fa1e Fixed unused declaration warnings 2026-07-21 15:07:57 +03:00
Mauro Romito 5d1e15f308 Revert "Support sending gallery messages behind a feature flag"
This reverts commit 6a2ed331fa.
2026-07-21 12:44:03 +02:00
Mauro Romito 6a2ed331fa Support sending gallery messages behind a feature flag
Adds the ability to send a gallery message (multiple attachments in one message)
via the media upload preview, wired through the timeline controller/proxy to the
SDK's sendGallery. Gated by a `galleryEnabled` developer flag (default off),
matching Element X Android — with the flag off, attachments are sent as
individual messages as before.

Extends the community PR #5601, rebased onto develop. Tracking:
element-hq/element-meta#3201

Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>
2026-07-21 12:09:07 +02:00
Mauro Romito 762e5ad0ff Revert "Support sending gallery messages behind a feature flag"
This reverts commit 9a61d870d6.
2026-07-21 12:00:03 +02:00
Mauro Romito 9a61d870d6 Support sending gallery messages behind a feature flag
Adds the ability to send a gallery message (multiple attachments in one message)
via the media upload preview, wired through the timeline controller/proxy to the
SDK's sendGallery. Gated by a `galleryEnabled` developer flag (default off),
matching Element X Android — with the flag off, attachments are sent as
individual messages as before.

Extends the community PR #5601, rebased onto develop. Tracking:
element-hq/element-meta#3201

Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>
2026-07-21 11:34:44 +02:00
Mauro 9093631f8b Periphery cleanup (#5893) 2026-07-20 11:16:11 +02:00
Doug a0ec5ed9dd Add the UI for your own user status in the Settings screen. (#5888)
* Show the user's own Status emoji on the SettingsScreen.

* Add the UI for setting your own status.

* Add placeholder action for selecting a custom emoji and fix some accessibility issues.
2026-07-17 12:21:51 +01:00
Mauro 39bd882a27 Fix for flaky tests (#5869)
* possible logging tests fix

* fix for flaky tests

* use timelimit for max test time

* pr suggestions

* remove comment
2026-07-14 18:01:36 +02:00
Doug 85f28d017d Update the SDK and handle API breaks. (#5871)
* Update the SDK and handle API breaks.

* Rename sdkUserThing to rustUserThing for consistency.

* Add user status ClientProxy methods.

* Rename UserStatus.UserSet to UserStatus.Raw.
2026-07-14 16:35:37 +01:00
Matthew Hodgson d8a2ac75a8 Fix CurrentValuePublisher.map dropping updates when the mapped publisher is chained inline (#5870)
* Fix CurrentValuePublisher.map dropping updates when the mapped publisher is chained inline

The eager implementation bridged through a second CurrentValueSubject fed by
a sink whose AnyCancellable was stored on the returned struct. Combine
consumes publisher structs when building a subscription, so chaining the
mapped publisher inline (e.g. `publisher.map { … }.removeDuplicates(…)
.sink { … }`, as RoomScreenViewModel and RoomDetailsScreenViewModel do for
knock requests) dropped the only copy holding that cancellable: the feeding
sink was cancelled and subscribers only ever received the initial value.

In practice this meant a room admin viewing a knockable room never saw the
"wants to join" banner (or a live "Requests to join" badge) for a knock
arriving while the room was open — it only appeared when the knock predated
opening the room. Caught by a live cross-client knocking test; the
double-execution of the transform at subscription time (eager transform +
current-value replay) was the giveaway.

Make map lazy instead: keep the transformed AnyPublisher and a value
provider, so subscribers attach straight through to the source subject (which
replays its current value itself) and no keep-alive is needed. Adds a
regression test chaining a mapped publisher inline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* swiftformat

* better docs

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Mauro Romito <mauro.romito@element.io>
2026-07-14 15:02:56 +02:00
Mauro Romito b730815842 disable creation and enabling of e2ee if remote preference for disabling it is true 2026-07-13 15:51:13 +02:00
Mauro e2c573b1eb Use deferFulfillment in flow coordinator tests (#5861)
* use deferFulfillment in coordinator tests

* pr suggestions
2026-07-13 11:52:22 +02:00
Mauro 6bd8423675 Media Preview content scanning (#5851)
* implemented checkSourceSafetyIfNeeded in the timeline media preview

* added a subtitle to the spinner when scanning and an animated drag gesture for the error and loading states

* pr suggestions

* pr suggestions part 2
2026-07-09 18:46:14 +02:00
Mauro ee89f8846f Fix for the media browser showing also images and videos in file mode (#5853)
* fix for the bug that makes the images appear in the file list of the media browser

* pr suggestions
2026-07-09 15:51:46 +02:00
Mauro 0a77ba6c90 Swift format enforce isEmpty rule (#5843)
* swift format enforce isEmpty rule

* revert scheme

* use trailing closure
2026-07-06 15:39:16 +02:00
Stefan Ceriu b8e6421551 Fix various project warnings 2026-07-03 19:30:28 +03:00
Stefan Ceriu 02d9ed1f0e Address search PR review comments
- Drop the redundant searchService coordinator/view model parameter; derive it from the client proxy.
- Rename the globalSearch avatar size to search.
- Lift the query observation streams out of their tasks.
- Restore the appeared and updateVisibleRange comments.
- Use CompoundIcon defaults and a scaledFrame for media previews.
- Simplify the result mapping with compactMap(makeResult) and drop unsupported events by returning nil.
- Move the preview helpers beneath the previews.
2026-07-03 13:39:45 +03:00