fix(platform-objects): drop invalid unique validation on sys_user#1492
Closed
os-zhuang wants to merge 1 commit into
Closed
fix(platform-objects): drop invalid unique validation on sys_user#1492os-zhuang wants to merge 1 commit into
unique validation on sys_user#1492os-zhuang wants to merge 1 commit into
Conversation
#1485 removed `'unique'` from the enforceable validation-rule types, but sys_user still declared a `type: 'unique'` validation — a semantic merge conflict on main that fails FlowSchema/ObjectSchema parse (ZodError: invalid discriminator value) and breaks Test Core for every PR. Email uniqueness is already enforced by the unique index (`indexes: [{ fields: ['email'], unique: true }]`), so the redundant validation block is removed. https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
Closing as redundant — Generated by Claude Code |
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.
Problem
mainis currently red on Test Core for every PR.packages/platform-objects/src/identity/sys-user.object.tsdeclares:But #1485 ("enforce all declared validation-rule types; trim the unenforceable three") removed
'unique'from the allowed validation-rule discriminator (script | state_machine | format | cross_field | json_schema | conditional). The two changes were a semantic merge conflict — each passed independently, but togethersys_userfails schema parse at registration:Fix
Remove the redundant
validationsblock. Email uniqueness is already enforced by the unique index declared on the same object:Uniqueness is an index concern, not an enforceable validation rule — which is exactly why #1485 dropped the type. No behavior change; just removes a now-invalid declaration.
Verification
@objectstack/platform-objectstests: 52 passed.sys_userwas the only object carrying a trimmed validation-rule type.This unblocks
Test Coreonmainand on the in-flight ADR-0031 PRs (#1489).https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
Generated by Claude Code