Skip to content

Player: BACK/Stop/EOS return to the page playback was started from - #238

Merged
GLinnik21 merged 5 commits into
mainfrom
fix/player-back-returns-to-detail
Sep 25, 2026
Merged

GLinnik21 merged 5 commits into
mainfrom
fix/player-back-returns-to-detail

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

What went wrong

On a debug build of main a788b27, the path Home → Detail → Play → BACK (or Stop) landed on Home instead of the detail page the film was started from.

This is a regression, not something that was never built. #178 introduced PageDip staging, and the 0.7.0 nightlies carry it from 2026-09-20 on. 0.6.x does not have it.

Root cause

The detail route is not replaced, and the exit is not hard-wired to Home. The problem is that the player's session origin is lost while its push is still in flight:

  1. enter_player (rust-modules/src/app/playback.rs:203) seeds the one-shot player_origin and requests Push(Player). In production this commit waits for the ~140 ms PageDip dip-out. During that dip-out the player body is already mounted, and mounting consumes the seed.
  2. If the engine goes live inside that window, the pump_play landing (rust-modules/src/app/run.rs:2051, "pump_play: engine started off-route → restoring AppArg::Player") asks for the player page again.
  3. NavStack::is_inert (rust-modules/src/ui/containers/stack.rs:182) never treated a repeat of the pending Push as inert. The second ask therefore replaced the pending op, and its fresh mount found the seed already spent (origin None).
  4. return_from_player (app/playback.rs:572) had no identified origin, so it fell back to nav_select_tab(Home).

Test dispatchers use Immediate, which is why no host test caught it.

Fix

The shared mechanism is fixed, and each launch path relies on it rather than carrying its own special case:

  • ui/containers/stack.rs: is_inert treats a repeat of the pending Push or Replace of the same instance as inert, as it already did for Root and SelectTab. The body prepared during the dip is the one that commits.
  • app/playback.rs enter_player: a player push that is already pending counts as "player already up". A second Play inside the dip therefore neither re-seeds nor leaves a dangling seed.
  • app/bridge.rs:2667 open_detail: the same rule applies to the other one-shot seed. A second open of the detail page already on its way writes no DetailSeed.

Consumers covered. Every player launch funnels through start_playback_with → enter_player, so all of them are covered by the one fix:

  • detail Play, including the held feature;
  • episode rows;
  • extras and trailers (item menu);
  • person and search results (both open detail first);
  • Continue Watching / Home play_item_now;
  • menu_play_tick and key_play;
  • dev scenarios.

The only second ask is the pump_play landing, and it is now inert in the container.

Other seeds.

  • DetailSeed is migrated (above).
  • library_kind is persistent state, and SelectTab was already inert.
  • A stray player_hud_ms is harmless: it is only a linger duration, and every start overwrites it.

End of stream without Up Next returns to the same origin as BACK/Stop, per the spec's §5.1 (finish_playback shares return_from_player).

Tests: RED, then GREEN

The new host tests use the production PageDip transition, and the engine goes live inside the dip.

Test RED before the fix GREEN
app::run back_from_the_player_returns_to_the_detail_page_it_was_started_from BACK from the player landed on ScreenId(4), not the detail page (ScreenId 4 = Home) passes
an_end_of_stream_without_up_next_returns_to_the_detail_page end of stream landed on ScreenId(4), not the detail page passes
back_from_a_session_started_on_home_returns_to_home green before and after; it pins the Continue Watching case passes
ui::containers a_repeated_ask_for_the_pending_page_keeps_its_prepared_body Push(Page(42)): the prepared body survives the repeat passes
app::playback a_second_play_inside_the_push_keeps_the_origin_and_leaves_no_seed (guard reverted) an unseeded player mount inherits no origin from the earlier session passes
app a_second_open_of_the_pending_detail_page_leaves_no_seed_behind no unspent seed is left for a later mount passes

Test-fixture commits

These make make check reliable on macOS.

  • Accepted-socket blocking mode. Darwin gives an accepted socket the listener's O_NONBLOCK, so fixtures that polled a nonblocking listener flaked with WouldBlock.
    • A new crate::testnet::accept accepts and puts the socket back in blocking mode.
    • Every acceptor that does I/O on the accepted socket now uses it: the route decision fixtures, net, curlio, ff support, the stall guard, library preferences, and the lifecycle rig.
    • Acceptors that only count connections (http, keepalive, checkpoint, ipv6, transcoder) are unaffected.
  • curlio teardown_aborts_a_runtime_source_probe_without_waiting_out_its_budget. The server answered the probe's Range with an immediate 200. When the test thread ran late, the probe ended on its own before the abort reached it.
    • RED, with a 100 ms late-teardown delay added: teardown must end the sample as an abort, got Err(Open(RangeIgnored)).
    • GREEN 6/6 once the server withholds its answer.

Gates (committed tree 567b5f7, git status --short empty before and after)

make check exit 0:

test result: ok. 4362 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 53.82s
test result: ok. 4418 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 52.72s
test result: ok. 101 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.17s
PASS: tsan, 17 cases
  • CARGO_INCREMENTAL=0 cargo +nightly check --manifest-path rust-modules/Cargo.toml --lib --no-default-features: Finished.
  • make (ARM): exit 0.

Review

There were two rounds of automated adversarial review, each checking that every fix is systematic.

  • Round 1: a duplicate detail open lost the updated season and left a dangling DetailSeed. Fixed in the shared open_detail path, test first.
  • Round 2: the accepted-socket fix had covered one fixture only. It is now centralised in crate::testnet::accept, and every consumer is migrated or shown above to be unaffected.
  • The round cap is two, so the round-2 fixes and the curlio test fix have not been re-reviewed.

Not yet verified

TV verification pending. Everything here is host-tested only; it has not run on the device.

🤖 Generated with Claude Code

GLinnik21 and others added 5 commits September 25, 2026 05:29
Since #178 the page dip-out PREPARES a pushed destination: its body mounts
before the floor, and that mount is where the player spends its one-shot
origin seed. `start_playback` pushes the player while the plan is still
resolving; when the plan lands inside the dip, the committed route still
names the detail page, so `update`'s landing arm asks for the player again
(`show_page(Player)`). `NavStack::request` replaced the pending push, dropped
the prepared player and prepared a fresh one whose seed was already spent,
so the session had no origin and every exit fell back to Home.

A repeated Push/Replace of the pending destination is now inert, like the
Root/SelectTab/PopTo twins already were, so the prepared body (and whatever
seed it consumed) survives. `enter_player` also treats a pending player push
as "already up", so a second Play inside the dip cannot leave an unspent
origin seed for a later unseeded player mount to inherit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An accepted socket inherits the listener's O_NONBLOCK on macOS, so a read
that beat the client's write panicked WouldBlock and failed the test
intermittently (2 of 5 isolated runs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up: the detail half of enter_player's pending-push rule. The
repeated Push is inert against its prepared twin, so a DetailSeed written
for it would never be spent by that page and would linger for a later,
unseeded mount of the same item.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Darwin hands an accepted socket the listener's O_NONBLOCK; Linux does not.
Fixtures that poll a nonblocking listener and then read or write the
accepted socket as if it blocked flaked on the Mac with WouldBlock. Five
fixtures had fixed that inline; the rest had not. crate::testnet::accept
does the accept and restores blocking mode, and every such acceptor now
uses it (route decision fixtures, net, curlio, ff support, stall guard,
library preferences, the lifecycle rig). Acceptors that only count
connections (http, keepalive, checkpoint, ipv6, transcoder) do no I/O on
the socket and are unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The server answered the probe's Range with a plain 200 at once, which the
probe refuses as RangeIgnored. When the test thread ran late — a loaded
suite — the probe ended on its own and retired its handle before teardown
signalled it: "got Err(Open(RangeIgnored))", or a 20 s spin ending in
"never published teardown's wake target". The server now withholds its
answer, so only the wake can end the probe, and the test waits 100 ms
before waking it so the late case is the case every run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T03:02:13.534779Z 567b5f7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 567b5f7092

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2678 to +2679
if d.nav.tabs.stack.pending_dest().is_some_and(|pending| pending.same_instance(&arg)) {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the newer season when deduplicating detail opens

When a second request opens the same show during the page dip, this early return discards its season and ret values because same_instance compares only the detail item identity. For example, the added test calls open_detail(..., Some(1), ...) followed by Some(2), but the committed page still uses season 1; the test only verifies that no seed remains. A rapid activation of a different season for the same show therefore ignores the user's latest selection, contrary to the stack's newest-request-wins behavior. Deduplicate the navigation without dropping the newer mount state, such as by updating the prepared destination.

Useful? React with 👍 / 👎.

@GLinnik21
GLinnik21 merged commit 6d0b8e5 into main Sep 25, 2026
5 checks passed
@GLinnik21
GLinnik21 deleted the fix/player-back-returns-to-detail branch September 25, 2026 03:11
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
#234, #235, #236, #237 and #239 passed on the television on a debug build
of 3a30a01, each with the log lines behind it; #238 stays pending (it
needs real playback), and #237's new focus-on-Sign-out finding is pending
its own fix. Records the second pass's harness results and marks the
0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what
was observed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
#234, #235, #236, #237 and #239 passed on the television on a debug build
of 3a30a01, each with the log lines behind it; #238 stays pending (it
needs real playback), and #237's new focus-on-Sign-out finding is pending
its own fix. Records the second pass's harness results and marks the
0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what
was observed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
…brary firmware gate (#241)

* docs: correct two claims #235 and #239 left stale

ci/build-ffmpeg.sh: the firmware database fwsym holds spans platform
releases 1.2.0 to 11.2.0, not webOS 3 to 10; libz.so.1 is in every image.
docs/trailer-ux-plan.md: the deferred just_finished proposal names the
preview machine's current transitions, Machine::eos and Machine::stopped,
as docs/TODOS.md already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* 0.7.0 release note and audit: cover #234-#240

The note gains the image-subtitle fix, the trailer stop/reporting/redirect
behaviour, the art-crop, library-seat and profiles read-out fixes, and a
line for nightly users about BACK from the player. The audit records the
seven changes as host-verified and pending the device pass, the bundled
FFmpeg's new libz.so.1 dependency with its firmware evidence, and the
https HLS cross-origin redirect gap as a known follow-up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: the audit lint refuses an unfilled placeholder in the authored half

Nothing substitutes into a release audit's authored half; gen-release-audit
only replaces the generated block, so a __PLACEHOLDER__ left there
publishes literally. Watched red on the v0.7.0 audit's __GATES__ row before
it was filled; every existing audit and the template pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: record the gates run on the release-prep tree

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: fold in the second device pass over #234-#240

#234, #235, #236, #237 and #239 passed on the television on a debug build
of 3a30a01, each with the log lines behind it; #238 stays pending (it
needs real playback), and #237's new focus-on-Sign-out finding is pending
its own fix. Records the second pass's harness results and marks the
0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what
was observed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* 0.7.0 release note and audit: #242 fixes the device pass's Sign-out focus finding

The audit lists #242 among the changes landed after the device pass,
host-verified and pending the device, and marks #237's focus-on-Sign-out
finding fixed by it. The note's smaller fixes gain the menu-focus line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: the gate row names the tree rebased onto #242

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* 0.7.0 note and audit: scope the trailer and library promises, record the pass's account writes

Review findings on #241:
- A trailer started with Play Trailer is an ordinary playback
  (request_play, preview: false) and reports a timeline; only the
  background preview, full-screen mode included, never reports.
- The library DOWN fix holds only when the reader has not moved before
  the shelves load.
- The device-pass summary counts #236 as passed only for shelves-first.
- The pass wrote to the Guest profile: the explicit PGS pick's
  PUT /library/parts selection, and the harness's unscrobble, progress
  seeds and playback timelines.
- The gate row states that every commit after b99e79f is note/audit
  only and which checks were re-run on the head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fwcompat: grade the bundled FFmpeg libraries, and put their DT_NEEDED in the audit

#235 gave libavformat-plx a DT_NEEDED on libz.so.1, and nothing graded it:
the libraries are dlopen'd, webosbrew-ipk-verify grades only the app and
service executables, and fwcompat on a bundled library reported every
firmware FAIL for the sibling libav*-plx names no firmware carries.

tools/fwcompat.py --shipped DIR takes DT_NEEDED names that are files in DIR
off the firmware's list and counts what they export as resolved. Watched:
bare, libavformat-plx FAILs everywhere on its siblings; with --shipped pkg
all three pass from 4.4.2 to 11.2.0; against a copy of the 4.4.2 database
with libz removed it FAILs on libz.so.1 (4 symbols) and exits 1.

CI's firmware load matrix and the build's fwcompat gate now run it over
each bundled library; the build appends the matrix to pkg/ipk-verify.md,
which gen-release-audit.py embeds, and gen-release-audit.py lists each
bundled library's DT_NEEDED. Review finding on #241: the zlib verdict is
now read from the published package instead of typed into the audit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: the zlib entry defers to the generated half; the gate row names the tooling commits

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fwcompat review: row() takes its cells, and --shipped says what it trusts

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build-package: the bundled-library matrix goes into ipk-verify.md unfenced

gen-release-audit.py already wraps that whole file in one code fence; a nested
fence closed it. Only the step summary fences the aligned columns now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant