Skip to content

Preview: a trailer halted before its landing finishes its request Cancelled, not as a direct-play refusal - #1372

Merged
GLinnik21 merged 3 commits into
mainfrom
lane/halted-preview-not-a-failure
Nov 13, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
lane/halted-preview-not-a-failure

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

When the detail page halts a trailer preview while its resolve is in flight, the landing that arrives afterwards starts no engine. Since #1274 that landing finished its request metric as Failed(PreviewNotDirect), so the app's attempt metrics recorded a direct-play refusal for a cancellation. It now finishes Cancelled, the same pair the viewer's exit and shutdown use.

  • Nothing outside the app saw the wrong outcome: metric notices are a local window; the preview's Sentry report (report::tick_preview) fires only on a genuine PreviewNeedsDirectPlay refusal, unchanged. Sentry PLX-NATIVE-23 is that genuine refusal, not this path.
  • PreviewReset (drop guard for the process-wide preview machine) moves to bridge_test_support.rs and is shared by this test and deeplink_route_tests.rs, so a panicking test cannot leave the machine Fetching for the rest of the binary.

Gates

  • New hostsim test a_preview_halted_before_its_landing_finishes_its_request_cancelled: red on main (left: Some(Failed(Failure { stage: Planning, cause: Unsupported })) right: Some(Cancelled)), green with the fix.
  • make test-hostsim: 1575 passed. make test-crate C=plxnative_modules: 1375 passed (before the guard move); T=deeplink: 34 passed after it.
  • Full gates: this PR's CI. Reviewed once (pr-reviewer): one MINOR finding (panic-safe reset), fixed in the second commit.

🤖 Generated with Claude Code

GLinnik21 and others added 3 commits November 13, 2026 02:11
… Failed(PreviewNotDirect)

PR #1274 made the landing of a preview nobody waits for any more (the hero
page halted it while its resolve was in flight) finish the metric request as
Failed(handled_failure(PreviewNotDirect)). The viewer only moved focus; no
route failed, so the request is a cancellation. It now finishes
RequestOutcome::Cancelled, which raises no handled-error effect and touches
none of report.rs's playback.* latches, so previews still emit no PostHog
playback event.

A genuinely refused preview (the resolve's own PreviewNeedsDirectPlay verdict)
is unchanged: it never reaches this landing branch and still reports
preview_not_direct through report::tick_preview.

Regression test in the hostsim app rig: a preview requested, halted while its
resolve is parked, then landed through update(). It failed against main with
Failed(Planning, Unsupported) and passes now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e on unwind

a_preview_halted_before_its_landing_finishes_its_request_cancelled called
preview::reset_for_test() only at its start, so a panic between request_start
and halt left the machine Fetching and every later test in the binary saw
preview::occupies() true. Move the PreviewReset Drop guard from
deeplink_route_tests.rs to the shared bridge test_support (next to ImageHeld),
use it from both, and bind it right after testlock::serial() here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 4abce8d into main Nov 13, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the lane/halted-preview-not-a-failure branch November 13, 2026 12:19
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