Skip to content

Qualify VS Code file edit, save, revert, and hot-exit recovery #269

Description

@wieslawsoltes

Parent epic: SceneTech/AppScene#122
Workspace/provider prerequisite: #252
Navigation prerequisite: SceneTech/AppScene#124
Native/local picker stack: SceneTech/AppScene#123 → #248
Release-wide acceptance: #260

Problem

Opening a selected folder and rendering Explorer does not prove that unchanged VS Code OSS can maintain file models safely. The current focused hierarchy has no owner for the complete remote editor lifecycle: open bytes, dirty state, Save, Save As, revert, conflict handling, backups/hot exit, and recovery after reload, navigation, crash, or restart.

The broad AppScene storage issue #33 proves durable browser storage for a typed record, and AppScene #32 covers app-corpus file transfer. Neither proves VS Code's text-file model, remote file-service writes, backup metadata, overwrite/error UX, or watcher/model reconciliation.

Investigation

Trace unchanged VS Code 1.137 from Explorer/file activation through ITextFileService, model creation, encoding/EOL detection, dirty-state transitions, IFileService read/write/stat, backup working copies, dialogs, and final watcher refresh. Record the exact reusable WebScene/AppScene contract at the first failure; keep raw paths limited to isolated fixtures.

Cover:

  • existing remote file open, edit, Save, Save All, Auto Save, Save As, revert, close-dirty prompt, and working-copy backup;
  • untitled-to-file, read-only, permission denied, missing/deleted, renamed, externally modified, stale etag, symlink, disk-full/short-write, disconnect/reconnect, and canceled overwrite flows;
  • UTF-8/BOM/UTF-16, EOL preservation, Unicode normalization, empty/binary/large/sparse files, long names, percent-encoded URI components, case-sensitive roots, and platform path separators;
  • atomic create/replace semantics, flush/durability expectations, no partial target on failure, own-write watcher de-duplication, and exact-once dirty/model/view updates;
  • backup/hot-exit restoration across reload, folder A → B → A, same-window navigation, host termination, crash recovery, profile restart, and unavailable original paths;
  • language-service/diagnostic/SCM/Search state after save, revert, rename, and recovery.

Ownership boundaries

Acceptance

  • Opening a remote fixture yields byte-exact editor content, encoding, EOL, language mode, resource URI, and one model.
  • Edit → Save → close → reopen preserves bytes and clears dirty state exactly once; Save All and Auto Save have explicit successful/canceled/error outcomes.
  • Remote and native/local Save As preserve the selected URI, requested target, overwrite policy, and grant lifetime without a VS Code source patch.
  • Revert and external-change conflicts match Chromium semantics and never silently discard unsaved bytes.
  • Failed, canceled, denied, stale, short, or disconnected writes leave the prior durable file intact and expose the correct recoverable error/focus state.
  • Hot exit restores every dirty working copy and untitled resource after reload/crash/restart, including multi-root workspaces; successful save removes obsolete backups.
  • Watcher events caused by the app and externally are reconciled once without duplicate models, prompts, Explorer rows, SCM entries, or diagnostics.
  • Path/URI, Unicode, symlink, encoding, large-file, and platform-separator fixtures pass with explicit supported/unsupported declarations.
  • Chromium/AppScene semantic, visual, focus, and accessibility comparisons pass for dirty tabs, prompts, conflicts, errors, and recovery.
  • Record cold/warm p50/p95 for open-to-editor, edit-to-dirty, save, revert, backup, and restore. Bound copied bytes, filesystem calls, DOM/scene publications, CPU, RSS, models, backups, watches, and handles over 100 cycles and representative large files.
  • WPT-derived file/stream/storage contracts, native failure-injection tests, unchanged packaged Code OSS acceptance, and final installed-SDK release gates pass.

Proposed PR stack

  1. Investigation-only correlated observer and product-neutral file-model/read/write fixture.
  2. Smallest provider/stream/write/error contract fix, if reproduced, with direct failure-injection and byte-integrity gates.
  3. Backup/hot-exit/restart contract over the durable storage primitives from AppScene [GPU 11/20] Complete WebGPU async errors, mapping, copies and device-loss semantics #33.
  4. Native/local Save As integration after AppScene Support nested CSS rules in modal layouts #123 and Implement File System Access pickers and handles over AppScene native panels #248, preserving the same file-model gates.
  5. Unchanged Code OSS cumulative acceptance plus visual/accessibility/performance/lifecycle gates; release qualification remains AppScene Keep captured Performance methods on one timeline #130.

Schedule

Start the remote open/edit/save slice after #247 and the minimal #252 provider/root path are proven. Run backup/recovery investigation in parallel with AppScene #33's released-SDK cleanup. Add native/local Save As only after the #123#248 stack. Merge focused reusable fixes before cumulative product acceptance.

Activity

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

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions