Skip to content

Keep a recorder reply that arrives before a shutdown - #196

Merged
Views2k merged 1 commit into
mainfrom
fix/recorder-reply-before-shutdown
Nov 9, 2026
Merged

Views2k merged 1 commit into
mainfrom
fix/recorder-reply-before-shutdown

Conversation

@Views2k

@Views2k Views2k commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Problem

RecorderProcessClient.SendAsync waits for the helper's reply through Task.WaitAsync(operation.Token). The reader sets the reply before it reports a later state or exit, but the wait observes the completed reply only after a queued continuation runs. When the helper finishes a save and then reports a transition or exits, a shutdown can cancel the wait first, and the finished save fails with the terminal reason instead of completing its library copy. This is the intermittent failure of FinishedSaveCompletesItsLibraryCopyAfterTheHelperClosesForATransition.

Change

A reply that has already arrived is used even when the wait reports cancellation first (src/Wisp.App/Clips/RecorderProcessClient.cs, 5 lines). Nothing else changes: a cancellation with no reply still throws.

Verification

  • The existing test covers the race; CI runs the full App suite on Windows.
  • Steam and Xbox: the recorder helper protocol is the same on both; no platform-specific path is touched.

Unverified: no in-game capture was run for this change; the fix is confined to the reply wait.

Closes #194

SendAsync observes a helper reply through Task.WaitAsync, which sees the
completed reply only after a queued continuation runs. When the helper
finishes a save and then reports a transition or exits, a shutdown can
cancel that wait first. The finished save then failed with the terminal
reason instead of completing its library copy.

A reply that has already arrived is now used even when the wait reports
cancellation first. This was the intermittent failure of
FinishedSaveCompletesItsLibraryCopyAfterTheHelperClosesForATransition.
@Views2k
Views2k marked this pull request as ready for review November 8, 2026 20:36
@Views2k
Views2k merged commit 0f1a7df into main Nov 9, 2026
10 checks passed
@Views2k
Views2k deleted the fix/recorder-reply-before-shutdown branch November 9, 2026 02:57
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.

A clip save that finishes just before a shutdown fails with the shutdown's reason

1 participant