Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple of race conditions when observing room info updates for calls. #3487

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Nov 5, 2024

This PR is the iOS part for element-hq/element-meta#2599. There were 2 issues at play:

  • A race condition between getting the value of hasRoomCall and it being used in the publisher which could result in a room info update being dropped when it shouldn't be.
  • An incoming call would launch the app if it had been killed and attempt to observe the room info update before a user session had been restored.

These issues also affected the ringing not being stopped when the caller hung up as well as the issue mentioned in the story (although honestly, the grace period for ringing is short enough that until I added logs I was often unsure if I had hit a timeout or the app was doing its thing correctly).

Note: I think there are still a couple of smaller issues with call ringing (possibly just matrix.org being slow as sometimes e.g. Call notification is too old would happen) and I wouldn't see CallKit appear at all or it would cancel almost immediately.

Screen.Recording.2024-11-05.at.1.29.11.pm.mov

@pixlwave pixlwave requested a review from a team as a code owner November 5, 2024 16:55
@pixlwave pixlwave requested review from Velin92 and stefanceriu and removed request for a team November 5, 2024 16:55
@pixlwave pixlwave added the pr-bugfix for bug fix label Nov 5, 2024
@pixlwave pixlwave changed the title Fix a race condition observing room info updates for calls. Fix a couple of race conditions when observing room info updates for calls. Nov 5, 2024
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏👏

Copy link

github-actions bot commented Nov 5, 2024

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.

Generated by 🚫 Danger Swift against 6dac0a2

Copy link

sonarqubecloud bot commented Nov 5, 2024

Copy link

codecov bot commented Nov 5, 2024

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
848 2 846 0
View the full list of 2 ❄️ flaky tests
PreviewTests test_roomMemberDetailsScreen()

Flake rate in main: 18.75% (Passed 650 times, Failed 150 times)

Stack Traces | 9.28s run time
failed - Snapshot "Verified User" does not match reference.

@−
"file:.../__Snapshots__/PreviewTests/test_roomMemberDetailsScreen-iPhone-16-pseudo.Verified-User.png"
@+
"file:.../tmp/PreviewTests/test_roomMemberDetailsScreen-iPhone-16-pseudo.Verified-User.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
      // ...
    }

The percentage of pixels that match 0.83825684 is less than required 1.0
The lowest perceptual color precision 0.148125 is less than required 0.98 (.../PreviewTests/Sources/PreviewTests.swift:84)
RoomScreenViewModelTests testPinnedEventsBanner()

Flake rate in main: 24.42% (Passed 164 times, Failed 53 times)

Stack Traces | 19.2s run time
Asynchronous wait failed: Exceeded timeout of 10 seconds, with unfulfilled expectations: "Awaiting publisher". (.../Sources/Extensions/XCTestCase.swift:43)

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@pixlwave pixlwave merged commit 5fc8cac into develop Nov 5, 2024
13 checks passed
@pixlwave pixlwave deleted the doug/ringing branch November 5, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix for bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants