frontend: validate the pipeline editor autosave entry with a zod schema - #2655
Merged
Merged
Conversation
Contributor
✅ Clean — no registry drift, off-token colours, or ad-hoc classesApp:
Generated by lookout audit-changes. |
r-vasquez
approved these changes
Sep 21, 2026
jvorcak
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #2624. The editor's crash-recovery buffer in
localStoragewas gated by a hand-written type guard that re-listed every field ofEditorAutosaveEntry, so the type and the check had to be kept in step by hand. This replaces the guard with a zod schema and derives the type from it, so there is one definition of what a valid entry looks like.editorAutosaveEntrySchemapinsversiontoAUTOSAVE_ENTRY_VERSIONand keepsbasedOnUpdateTimenullish, as before.readAllrunssafeParseper entry and drops the ones that fail, so a stale or corrupt shape still can't reachform.reset.Testing
rpcn-editor-autosave.test.tsxpasses under the integration config.bun run type:checkand Biome are clean on the changed file.🤖 Generated with Claude Code