Repository navigation
fix: apply default invalid where behavior when options are omitted - #12595
belljinwo-jpg wants to merge 4 commits into
Conversation
|
/claim #12578 |
Code Review by Qodo
1.
|
|
Addressed the automated security finding in cf7b4ef: normalized criteria now use a null-prototype accumulator, so special keys such as `proto` remain own WHERE keys without invoking Object.prototype setters. Added a regression test using JSON-parsed criteria. Verification: TypeScript compilation passed; focused suite 19 passing; complete SQL.js suite 2,966 passing, 179 pending, 0 failing. |
|
Addressed both remaining review recommendations in ee6661a. The issue regression now lives in the functional write-path suite and covers default null/undefined behavior for EntityManager.update/delete. The prototype-key regression is also exercised through an actual update and verifies the row remains unchanged. The unit-only block and its `any` cast were removed. Verification: TypeScript compilation passed; focused functional suite 23 passing; complete SQL.js suite 2,964 passing, 179 pending, 0 failing. |
|
Addressed the new entity-criteria finding in 1e5829b. Entity instances retain historical passthrough only when invalidWhereValuesBehavior is omitted; explicitly configured behavior now validates them. Added functional coverage for entity-instance criteria under explicit throw configuration. Verification: TypeScript compilation passed; focused functional suite 24 passing; complete SQL.js suite 2,965 passing, 179 pending, 0 failing. |
|
Closing as this is a duplicate of #12579 |
fix: apply default invalid where behavior when options are omitted
Closes #12578.
What changed
OrmUtils.normalizeWhereCriteria()now applies the documented default behavior wheninvalidWhereValuesBehavioris omitted: bothnullandundefinedvalues throw in high-level mutation criteria.The implementation also preserves the historical passthrough for entity-instance criteria only when the options argument is omitted. When a
DataSourceexplicitly configures invalid-value behavior, entity instances are normalized and the configured behavior is honored.Normalized criteria use a null-prototype accumulator so keys such as
__proto__remain ordinary own WHERE keys without mutating the result prototype.Functional regression coverage
undefinedandnull{ undefined: "ignore" }behavior remains supported__proto__remains an own criteria key without prototype mutationVerification
Opire
This PR targets the USD 300 Opire reward attached to issue #12578.