fix(metadata-admin): client validation never stricter than the live server (spec-skew root-cure)#1577
Merged
Merged
Conversation
…erver (spec-skew root-cure) The Studio editor validated drafts with the BUNDLED @objectstack/spec Zod schema, which can lag the running server. After a server-side schema relaxation (e.g. report.objectName/columns made optional for the ADR-0021 dataset dual- form), the editor showed false "required" errors on perfectly valid drafts. Root-cure: pass the live server schema (RichMetadataTypeEntry.schema, from /meta/types) into validateMetadataDraft and suppress "missing required field" issues for top-level fields the SERVER marks optional. Only suppresses when the field is actually absent (a present-but-invalid field still surfaces), so the client can never be stricter than the live server. Generic — any future schema relaxation is respected automatically, no per-change shim (cf. the existing FORWARD_COMPAT_FLOW_NODE_TYPES hack this generalises). Tests: clientValidation.skew (4) — suppresses stale required; never over- suppresses present-but-invalid; legacy strict behavior without a server schema. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
The Studio editor validated with the BUNDLED spec Zod, which can lag the server, causing false "required" errors after a server-side relaxation (e.g. report dual-form). Fix: pass the live server schema into validateMetadataDraft and suppress missing-required issues for fields the server marks optional (only when absent; present-but-invalid still surfaces). Generic — any future relaxation respected, no per-change shim. Tests: clientValidation.skew (4). Verified live: dataset-bound report editor no longer shows the false banner.
🤖 Generated with Claude Code