Skip to content

fix ios player not detecting view change when same flow reloads #796

Merged
nancywu1 merged 6 commits intomainfrom
fix-ios-player-stuck-at-end-state
Feb 10, 2026
Merged

fix ios player not detecting view change when same flow reloads #796
nancywu1 merged 6 commits intomainfrom
fix-ios-player-stuck-at-end-state

Conversation

@nancywu1
Copy link
Copy Markdown
Contributor

@nancywu1 nancywu1 commented Feb 6, 2026

Problem:
If new flow is returned from flow manager with identical flow (just different data) we hit this guard in SwiftuiPlayer

the context of the previous flow doesnt get cleared because no new view change is detected causing it to remain in End state using the stale cached player so buttons on screen dont work (transitions)

Solution:
instead of onAppear we use onChange to detect changes in loading state, this ensures unload() is called regardless of whether SwiftUI considers the view "new", which sets player = nil and allows the caching guard to pass on the next load().

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major
  • N/A

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

@nancywu1 nancywu1 requested a review from a team as a code owner February 6, 2026 01:07
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.81%. Comparing base (e9286b2) to head (675191b).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../swiftui/Sources/ManagedPlayer/ManagedPlayer.swift 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #796      +/-   ##
==========================================
- Coverage   85.82%   85.81%   -0.01%     
==========================================
  Files         505      505              
  Lines       22814    22823       +9     
  Branches     2657     2657              
==========================================
+ Hits        19579    19586       +7     
- Misses       2907     2909       +2     
  Partials      328      328              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nancywu1 nancywu1 marked this pull request as draft February 6, 2026 16:23
@nancywu1 nancywu1 changed the title fix ios player stuck at end state fix ios player not detecting view change when same flow reloads Feb 9, 2026
@KVSRoyal KVSRoyal added the patch Increment the patch version when merged label Feb 9, 2026
@nancywu1 nancywu1 marked this pull request as ready for review February 10, 2026 13:51
@nancywu1 nancywu1 merged commit 9649c85 into main Feb 10, 2026
14 of 15 checks passed
@nancywu1 nancywu1 deleted the fix-ios-player-stuck-at-end-state branch February 10, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Increment the patch version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants