#1711·OpenMAIC

[Bug]: Post-#1656 element-reference follow-ups: pick mode on whiteboard transitions, malformed-snapshot 500s

Author: LING-6150Created Sep 28, 2026Updated Sep 29, 2026
Labelsbug

Summary

Track the remaining scoped fixes after #1656. #1681 and #1682 are complete within their agreed scopes.

@wyuc Could you confirm the proposed scope and order below: B first, then A? Optional items C/D are not required to close this issue.

Checked against main@1c70e86a.

B. Cancel active picking on panel transitions

When the whiteboard opens or closes and the destination surface is also pickable, pick mode can remain active and switch surfaces. Manual opening already cancels picking; manual closing and automatic transitions are not consistently covered.

  • Cancel active picking when whiteboardOpen changes.
  • Preserve existing reference-draft invalidation and cleanup behavior; cancelling picking must not itself clear an already-selected reference.
  • Add focused regression coverage and browser verification for manual closing and automatic opening/closing.

Browser check (Playwright Chromium, mocked APIs; pick-mode files identical to main@1c70e86a): both paths reproduce.

  1. Arm picking on the whiteboard, then close it manually: the slide pick overlay becomes active.
  2. Arm picking on a slide during playback, then a wb_open action opens the board: whiteboard picking becomes active.
ImageImage

Manual opening still cancels picking as expected. Automatic closing was not separately exercised.

A. Reject the verified malformed snapshot cases with 400

Route probes reproduced HTTP 500 for these forged inputs:

  • Table: data = {}, a null row, a null cell, missing colWidths, or rowHeights = {}.
  • Code: lines = {} or a null line.
  • Slide references: a null member in scenes, or missing selected-scene content / content.canvas.

There is no evidence that normal browser requests produce these shapes.

  • Return INVALID_REQUEST / 400 through the existing validation-error path, before model resolution and without an accepted-reference header.
  • Add base-failing/fix-passing route regressions for the listed cases, covering slide and whiteboard where applicable.
  • Preserve valid projections, omitted optional fields, and HTTP 500 for unexpected resolver exceptions.

Scope is limited to this list. No whole-course schema validation or blanket exception-to-400 conversion.

Completion

Close when A and B are merged and verified.

Optional follow-ups, outside these completion criteria:

  • C: reduce repeated whiteboard picker DOM scans.
  • D1: assess consistent nonce fencing across reference evidence.
  • D2: improve generic 400 error messages shown to students.

Track these separately if pursued.