Skip to content

P0: snapshot save/recall UI must fail atomically on storage and malformed data #132

Closed

Description

@masarray

Source-verified regression in main@bc11edf (2026-10-29)

web/app.js currently mutates scenes and sceneIdx before persistSession() in saveMixerSnapshot(). When localStorage.setItem throws (quota / denied storage), only the userSnapshots object is rolled back; the list and selected index remain changed, making a never-saved scene appear active. loadSnapshotByIndex(i) also updates sceneIdx before invoking applySession(), which returns early on malformed schema but the rejected scene is still selected/persisted. persistSession() writes current, snapshots, chains as three independent keys, so a mid-write failure can persist a partial generation.

Incremental repair, no visual/engine redesign

  • Keep candidate list/index/state local until the entire storage transaction is successful; on errors restore the prior UI projection and explicitly report failure.
  • Reject malformed/unsafe/duplicate names and reject invalid data before selecting and applying. Make applySession() validate before mutation and return a boolean; do not mark failed recall as success.
  • Use a single versioned, bounded envelope for UI-only preview state with one localStorage key + migration from the three legacy keys; test quota/unavailable/partial old data and factory name protections. Do not misrepresent this as native VST3 recall.
  • Add realistic browser interaction cases for save, restart, overwrite confirm, delete confirm, corruption, storage denied and rollback. Preserve exact web/styles-src/standalone build parity, BTN-180 grey-off/green-on, no extra animation or polling.
  • Do not overwrite latest P1J route ACK or real native controls. Native P4 ShowV2 schema is separate PR P4 stage 1: bounded native ShowV2 / 10CH SnapshotV2 wire schema and CTest #131; later GUI projection must be backed by native ACK and Studio/Shows workspace.

Acceptance

A failed save/delete/recall never changes sceneIdx, visible scene list, live mixer state, or durable accepted snapshot data; stale/partial storage cannot claim successful native recall. Native WebView remains truthful about unsupported full-scene replay.

Activity

  1. masarray commented on Oct 29, 2026

    @masarray
    OwnerAuthor

    Fixed browser/UI-only snapshot atomicity by merged PR #154 (main squash a5e2c309025f83c24f27c42b730162ae7efac22d). The former 3 independent localStorage keys have been replaced by one versioned envelope; snapshot save/delete/recall and session import validate and commit before mutating visible state. On rejected/blocked storage, no false-success scene/index mutation. Legacy multi-key read/migration remains. Deterministic blocked-storage, invalid-state, and successful-restore tests were included in the existing Chromium/Node CI (run 40866136735 SUCCESS). This resolves the UI-only bug, not native all-VST3 Show/session recall or hardware FAT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions