fix(apps): instrument desktop render path to localize blank-screen (VAPP-47) #58

Merged
David merged 2 commits from fix/VAPP-47-desktop-render-diagnostics into main 2026-06-29 02:55:46 +02:00
Owner

What

The Desktop tab renders nothing even though the WS inspector confirms JPEG tiles arriving (2053 messages / 1.43 MB). I verified the whole pipeline is correct on inspection: the agent (run_desktop) emits cmd 7 (screen size) -> displays -> cmd 3 tiles; the relay forwards transparently and pump_socket eats only the first protocol-byte frame per side (so cmd 7 survives); tile X/Y are pixel coordinates; the browser process_frames/draw_tile parse, decode (createImageBitmap), and blit correctly, copying the JPEG (Uint8Array::from) so there is no wasm-memory aliasing.

That leaves a runtime condition that was being silently swallowed: either a missing/garbled screen-size frame (canvas stays at the default 300x150, so tiles draw off-canvas and it looks blank), or a JPEG the browser's createImageBitmap rejects.

What this PR does

Surfaces those instead of hiding them (NEVER HIDE ERRORS, per VAPP-42):

  • process_frames: one-shot logs the first relay payload's length + leading cmd/size; warns once on a malformed/truncated frame (relay/framing desync); logs when cmd 7 sizes the canvas (WxH); warns once if a tile arrives before any cmd 7.
  • draw_tile: logs the first few createImageBitmap/draw failures (bounded so it cannot flood at frame rate) instead of dropping them silently.

Diagnostics only - no behavior change to a working stream. This is the localize-first step in VAPP-47; it does not yet fix the root cause (which the logs will pinpoint).

Next step (needs a redeploy + one test)

Open the Desktop tab with the browser console open and report which line fires:

  • screen size WxH; canvas sized then nothing visible -> decode/draw issue (look for tile ... failed).
  • tile received before any screen-size (cmd 7) frame -> cmd 7 missing/misparsed.
  • malformed frame at off=... -> relay/framing desync.
  • tile JPEG decode (createImageBitmap rejected) -> the agent's JPEG is not browser-decodable.

I'll land the targeted fix once we know which.

Part of VAPP-47. Relates to VAPP-42.

🤖 Generated with Claude Code

## What The Desktop tab renders nothing even though the WS inspector confirms JPEG tiles arriving (2053 messages / 1.43 MB). I verified the whole pipeline is correct on inspection: the agent (`run_desktop`) emits cmd 7 (screen size) -> displays -> cmd 3 tiles; the relay forwards transparently and `pump_socket` eats only the first protocol-byte frame per side (so cmd 7 survives); tile X/Y are pixel coordinates; the browser `process_frames`/`draw_tile` parse, decode (`createImageBitmap`), and blit correctly, copying the JPEG (`Uint8Array::from`) so there is no wasm-memory aliasing. That leaves a runtime condition that was being silently swallowed: either a missing/garbled screen-size frame (canvas stays at the default 300x150, so tiles draw off-canvas and it looks blank), or a JPEG the browser's `createImageBitmap` rejects. ## What this PR does Surfaces those instead of hiding them (NEVER HIDE ERRORS, per VAPP-42): - `process_frames`: one-shot logs the first relay payload's length + leading `cmd`/`size`; warns once on a malformed/truncated frame (relay/framing desync); logs when cmd 7 sizes the canvas (`WxH`); warns once if a tile arrives before any cmd 7. - `draw_tile`: logs the first few `createImageBitmap`/draw failures (bounded so it cannot flood at frame rate) instead of dropping them silently. Diagnostics only - no behavior change to a working stream. This is the localize-first step in VAPP-47; it does not yet fix the root cause (which the logs will pinpoint). ## Next step (needs a redeploy + one test) Open the Desktop tab with the browser console open and report which line fires: - `screen size WxH; canvas sized` then nothing visible -> decode/draw issue (look for `tile ... failed`). - `tile received before any screen-size (cmd 7) frame` -> cmd 7 missing/misparsed. - `malformed frame at off=...` -> relay/framing desync. - `tile JPEG decode (createImageBitmap rejected)` -> the agent's JPEG is not browser-decodable. I'll land the targeted fix once we know which. Part of VAPP-47. Relates to VAPP-42. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(apps): instrument desktop render path to localize blank-screen
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m30s
39abd5b977
The Desktop tab renders nothing even though the WS inspector shows JPEG tiles arriving (2053 msgs / 1.43 MB). The agent emits cmd 7 (screen size) -> displays -> cmd 3 tiles correctly, the relay forwards transparently and eats only the protocol-byte frame, tile X/Y are pixel coords, and the browser parse/decode/draw code is correct on inspection. So the failure is a runtime condition that was being swallowed: a missing or garbled screen-size frame leaving the canvas at its default 300x150 (tiles draw off-canvas), or a JPEG the browser's createImageBitmap rejects.

Surface those instead of hiding them (NEVER HIDE ERRORS): process_frames now one-shot-logs the first payload's length and leading cmd/size, warns once on a malformed/truncated frame (relay/framing desync), logs when cmd 7 sizes the canvas, and warns once if a tile arrives before any cmd 7. draw_tile now logs the first few createImageBitmap / draw failures (bounded so it can't flood at frame rate) instead of dropping them silently. Diagnostics only; no behavior change to a working stream.

#VAPP-47
Merge branch 'main' into fix/VAPP-47-desktop-render-diagnostics
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m13s
Create release / Create release from merged PR (pull_request) Has been skipped
8da2363a9f
David scheduled this pull request to auto merge when all checks succeed 2026-06-29 02:54:53 +02:00
David merged commit b8421f5c1f into main 2026-06-29 02:55:46 +02:00
David deleted branch fix/VAPP-47-desktop-render-diagnostics 2026-06-29 02:55:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!58
No description provided.