Environment
@objectstack/*@17.0.0-rc.6, Console record create dialog.
Summary
The create form's submit-time required validation appears to be snapshotted when the dialog mounts. A requiredWhen predicate that later flips to FALSE updates the display layer (the required star disappears as expected) but not the validation layer: submit is still refused with " 不能为空", and no POST is issued at all.
Minimal repro (generic shape)
Object with a select field A (no defaultValue) and a lookup field B:
B: Field.lookup({
requiredWhen: P`!(has(record.A) && record.A == "x")`,
})
- Open the create dialog →
B shows the required star (A key absent ⇒ predicate TRUE — expected).
- Pick
A = "x" → B's required star disappears (live re-evaluation works on the display layer).
- Click Create → error "B 不能为空", and no
POST /api/v1/data/<object> request is issued.
- Control: open an edit dialog on an existing record whose
A is already "x" → B unstared, save PATCHes 200. The only difference from step 3 is whether A had a value at mount time — which is what implicates a mount-time snapshot.
Assertions observed
- After step 2:
B's label contains no *, no required marker in the field container.
- After step 3: inline error "B 不能为空" appears; network shows zero create POSTs.
- Server-side control (only the client is affected): direct
POST /api/v1/data/<object> with {"A":"x"} and no B → 201; with A at another value and no B → 400 VALIDATION_FAILED. Server requiredWhen semantics are correct.
Expected
Submit-time validation should consume the same live resolveFieldRuleState result that drives the required star, not a snapshot taken at dialog mount.
Related (checked before filing — distinct issues)
Impact
Any "conditionally optional" field whose driving field has no defaultValue can never be left empty on a create form, even when the author's predicate says it may be. In the reporting app this pattern occurs 10+ times across objects.
Environment
@objectstack/*@17.0.0-rc.6, Console record create dialog.Summary
The create form's submit-time required validation appears to be snapshotted when the dialog mounts. A
requiredWhenpredicate that later flips to FALSE updates the display layer (the required star disappears as expected) but not the validation layer: submit is still refused with " 不能为空", and no POST is issued at all.Minimal repro (generic shape)
Object with a select field
A(no defaultValue) and a lookup fieldB:Bshows the required star (Akey absent ⇒ predicate TRUE — expected).A = "x"→B's required star disappears (live re-evaluation works on the display layer).POST /api/v1/data/<object>request is issued.Ais already"x"→Bunstared, save PATCHes 200. The only difference from step 3 is whetherAhad a value at mount time — which is what implicates a mount-time snapshot.Assertions observed
B's label contains no*, no required marker in the field container.POST /api/v1/data/<object>with{"A":"x"}and noB→ 201; withAat another value and noB→ 400 VALIDATION_FAILED. ServerrequiredWhensemantics are correct.Expected
Submit-time validation should consume the same live
resolveFieldRuleStateresult that drives the required star, not a snapshot taken at dialog mount.Related (checked before filing — distinct issues)
requiredWhen+ a runtimedefaultValuestill deadlocks a create form (the conditional half of #4069) #4085 is the nearest neighbour but a different defect: there the predicate resolves TRUE on create and the deadlock comes from the producer-owned runtimedefaultValueinterplay. Here the predicate resolves FALSE by submit time and the block comes from the stale mount-time snapshot; no runtime default is involved (Adeliberately has none).Ahas no default, so the snapshot is always "required".Impact
Any "conditionally optional" field whose driving field has no
defaultValuecan never be left empty on a create form, even when the author's predicate says it may be. In the reporting app this pattern occurs 10+ times across objects.