You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Import dry-run skips field-level validation: dryRun:true reports ok:1 for a row the same endpoint then rejects #3956
POST /api/v1/data/:object/import runs field-level validation only on the real write, not on the dry run. The exact same request body with dryRun:true reports the row as valid; with dryRun:false it fails. The Console import wizard surfaces the dry run as "验证数据 / 导入前在服务端逐行校验", so users are told their file is clean and then watch the import drop every row.
Real write — same endpoint, same payload, only dryRun flipped:
{"object":"os_tianshun_ehr_penalty_standard","dryRun":false,"writeMode":"insert",
"total":1,"ok":0,"errors":1,"created":0,"updated":0,"skipped":0,
"results":[{"row":1,"ok":false,"action":"failed",
"error":"penalty_amount must be ≥ 0","code":"VALIDATION_FAILED"}]}
UI shows 「已导入 0 条 / 已跳过 1 条 · 第 1 行:penalty_amount must be ≥ 0」.
Note the dry run even claims created: 1.
Expected
The dry run should run the same validateRecord pass as the write path and report ok:0, errors:1 with the same per-row error. A dry run that does not validate is worse than no dry run — it converts "your file has a problem" into a false all-clear.
Scope
Not specific to min/max — the dry run appears to cover only mapping/lookup resolution (it does catch 申请部门: 找不到匹配 "X" 的记录 and required-lookup misses). Anything enforced by validateRecord (numeric range, string length, type checks) is invisible to it, so the same false all-clear should reproduce with e.g. maxLength.
Impact
Found while adding range guards to the settlement fields of a production MES app (25 objects). The import wizard is the primary bulk-data path during implementation; a green pre-check that doesn't predict the write outcome makes the whole pre-check step untrustworthy, and reviewers can't use it as acceptance evidence.
Related: the per-row error string is hardcoded English + API field name — filed separately.
Activity
fix(rest): import dry run must bound-check values, not just coerce th…
merge: main into claude/issue-3957-review-8c0daf — rebuild #3957 on A…