Skip to content

feat(webapp): end the recording when the web recorder is stopped - #2121

Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 1 commit into
masterfrom
feat/web-recorder-ended-close
Oct 29, 2026
Merged

irvingouj@Devolutions (irvingoujAtDevolution) merged 1 commit into
masterfrom
feat/web-recorder-ended-close

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Gateway keeps a recording open for its reconnection window after any push close, so live viewers of a browser recording only saw it end after that delay.

The WebM and asciicast recorders now close the push with code 4011 when stop() is called, which tells Gateway the recording is over. Failures, and the asciicast recorder restarting its own push, still close without a code and keep the recording open for a reconnection. The code is exported as RECORDING_ENDED_CLOSE_CODE.

Issue: DGW-477

@irvingoujAtDevolution

Copy link
Copy Markdown
Contributor Author

How this was checked (the package has no test setup):

  • pnpm --filter @devolutions/web-recorder build and biome check clean.
  • Throwaway loopback check against a local WebSocket server that records the close code it receives, using the built dist/index.js:
    • AsciiCastV2Recorder.stop() (Node 24): 4011.
    • AsciiCastV2Recorder.start() while already recording: the old push closes with no code (1005), so Gateway keeps waiting for the new push.
    • WebMRecorder.stop() (Chromium via Playwright, canvas capture for 1.5 s): 4011, after 2609 bytes were pushed, so the final chunk still goes out before the close.

Stacked on #2116, which teaches Gateway what 4011 means.

Note

LLM-assisted content (no human feedback).

@CBenoit Benoît Cortier (CBenoit) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused changes preserve reconnectable closures while signaling intentional recording completion, with no unresolved findings.

No open issues 🎉

What changed in this PR

Ends browser recordings immediately on explicit stop, avoiding Gateway’s reconnection delay for live viewers.

Changes:

  • Sends close code 4011 for intentional stops in both recorders.
  • Preserves reconnectable closures for failures and internal restarts.
  • Exports the shared close-code constant.
File Description
webapp/​packages/​web-recorder/​src/​webm-recorder.ts Distinguishes intentional stops from failures.
webapp/​packages/​web-recorder/​src/​index.ts Exports the recording-ended close code.
webapp/​packages/​web-recorder/​src/​close-codes.ts Defines and documents code 4011.
webapp/​packages/​web-recorder/​src/​asciicast-v2-recorder.ts Sends the code on explicit stops, not restarts.

Review effort: Balanced

@irvingoujAtDevolution

Copy link
Copy Markdown
Contributor Author

Lines changed, against master:

Added Removed
Production code 22 9
Tests 0 0
Other 0 0

All of it is the web-recorder package: close-codes.ts defines the close code, and both recorders send it when stopped.

Note

LLM-assisted content (no human feedback).

Base automatically changed from fix/jrec-push-ended to master October 28, 2026 20:13
Gateway keeps a recording open for its reconnection window after any
push close, so live viewers of a browser recording only saw it end
after that delay.

The WebM and asciicast recorders now close the push with code 4011
when stop() is called, which tells Gateway the recording is over.
Failures, and the asciicast recorder restarting its own push, still
close without a code and keep the recording open for a reconnection.
The code is exported as RECORDING_ENDED_CLOSE_CODE.

Issue: DGW-477
@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) merged commit 352312e into master Oct 29, 2026
53 checks passed
@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) deleted the feat/web-recorder-ended-close branch October 29, 2026 23:43
Benoît Cortier (CBenoit) pushed a commit that referenced this pull request Oct 30, 2026
Bumps \`@devolutions/web-recorder\` to 0.2.0 so the change from #2121
gets published. \`stop()\` now closes the push with
\`RECORDING_ENDED_CLOSE_CODE\`, and that constant is a new export.

Issue: DGW-477
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants