Repository navigation
fix(deps): update zod to 4.6.7 so bounded collections stop walking every element before their size check - #9386
waleedlatif1 wants to merge 2 commits into
Conversation
…ery element before their size check
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[High impact] The PR appears safe to merge; no actionable regression was found. SummaryUpdates
Acknowledged intent:
|
|
Closing in favor of backporting the upstream size-bound fix (colinhacks/zod#6652) onto 4.3.6 as a bun patch. 4.6 also changes absent-key handling for unknown/any properties, datetime precision, and root |
Summary
.max()/.length()/.size()on arrays, sets and maps ran only after every element was parsed, so an oversized body against a bounded schema (e.g. the deployed-chatfilesarray) cost memory per element. 4.6.7 checks the bound first$ref+$defsfor a schema with.meta({ id }). AddedinlineRootRefin@sim/utils/json-schemaand used it where Sim reads the root: the MCP catalog (otherwiseexecuteWorkflow'sx-run-id/x-sim-viaheaders disappear from the allowlist), the OpenAPI generator and check, and the v2 CLI generatorz.iso.datetime()strict RFC 3339 and rejects minute precision (2026-01-01T06:15Z). AddedisoDateTimeSchemain contract primitives with the 4.3 grammar, issue and JSON Schema, and used it at untrusted input boundaries: list-logs filters, v2 run-window bounds, workspace fileexpectedUpdatedAt, table analytics and TTL values, integration tool inputs (CloudTrail, Lambda, SailPoint, Resend, Buffer, QuickBooks webhook), and the chatlastObservedAt. Fields that only hold Sim's owntoISOString()output stay stricttypearrays (4.6 compacts nullable unions to["string","null"]), and both generators keep a.meta({ default })that 4.6 drops from a transforming schema's input sidesearch_workspacefilter dates stay strict: that file is mirrored into the worker verbatim, and its callers (LLM tool args, UItoISOString()) already send secondsType of Change
Testing
executeWorkflowcaller headers and that no operation slot is a bare$ref; red withoutinlineRootRefisoDateTimeSchemaaccepts minute precision with Z/offset and rejects malformed values; red (withttl.test.ts) when swapped forz.iso.datetime(). Cross-checked against zod 4.3.6 on 16 samples × both modes, 0 mismatchesbun run teston lib/api/contracts, lib/api/mcp, script tests for the CLI/MCP/OpenAPI generators, realtime-protocol, realtime handlers, and neighbors of every touched file (table, buffer, sailpoint, chat post, dashboards, knowledge transfer, quickbooks, logs, v2 routes): all passcheck:openapi,check:cli-api,check:mcp-operations,check:tool-metadata,bun run lintChecklist
test-auditauthoring gate)