Skip to content

fix: clear form snapshots on unmount - #582

Closed
JustYannicc wants to merge 115 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/form-runtime-snapshot-cleanup-20260704
Closed

fix: clear form snapshots on unmount#582
JustYannicc wants to merge 115 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/form-runtime-snapshot-cleanup-20260704

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Added ownership-aware cleanup for Raycast Form runtime global submitted value, error, and placeholder snapshots when a Form unmounts.
  • Tagged snapshot writes from each mounted Form instance so an older unmount does not clear a newer active Form snapshot.
  • Added a focused Node harness that mounts, updates, and unmounts the Form runtime and measures retained snapshot keys and serialized bytes.

Why

Unmounted Form views left module-global snapshots populated for Action.SubmitForm, retaining submitted values, errors, placeholders, and any nested object graphs after the view was gone.

Compatibility impact

No public Raycast API behavior changes while a Form is mounted. getFormValues() still preserves placeholder fallback behavior for blank values, and existing submit semantics remain unchanged for mounted Forms.

How tested

  • node --test scripts/test-form-runtime-error-state-noop.mjs scripts/test-use-form-error-state-noop.mjs scripts/test-form-runtime-snapshot-cleanup.mjs
  • node scripts/test-form-runtime-snapshot-cleanup.mjs --report
  • npm run typecheck:renderer
  • Codex LSP status, references, and diagnostics on the edited Form runtime files.

Performance evidence

Focused snapshot harness report:

  • Before unmount: 6 retained snapshot keys, 1161 serialized bytes.
  • After unmount cleanup: 0 retained snapshot keys, 6 serialized bytes for three empty snapshot objects.

Stack validation

Started from codex/perf-wave3-integration-stack-20260704 at 206eab8280a2eb91a57e4e74ea6df99e45a55cb4. The implementation is limited to Form runtime snapshot cleanup and focused tests.

Replaces

None.

…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	scripts/bench-script-command-discovery.mjs
#	scripts/benchmark-file-search-delete-batch.mjs
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-file-search-delete-batch.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/file-search-index.ts
#	src/main/main.ts
…perf-wave2-integration-stack-20260704

# Conflicts:
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-extension-lifecycle-sandbox.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/main.ts
#	src/renderer/src/ExtensionView.tsx
…perf-wave2-integration-stack-20260704

# Conflicts:
#	.github/workflows/project-checks.yml
#	scripts/test-root-search-perf.mjs
#	src/renderer/src/CameraExtension.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…erf-wave3-integration-stack-20260704

# Conflicts:
#	package.json
#	scripts/measure-extension-bundle-cache.mjs
#	scripts/test-icon-runtime-file-icon-cache.mjs
#	src/main/extension-runner.ts
#	src/renderer/src/components/HiddenExtensionRunners.tsx
#	src/renderer/src/raycast-api/icon-runtime-render.tsx
…/perf-wave3-integration-stack-20260704

# Conflicts:
#	scripts/test-browser-search-performance.mjs
#	scripts/test-root-search-perf.mjs
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by the clean consolidated wave4 renderer/Raycast PR: #599. That branch contains this PR's covered change on current main without the inherited broad-stack noise.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant