test(wasm-sdk): remove invalid position from document-type root in fixtures#3524
Conversation
…fixtures Four test fixtures in the wasm-sdk functional test suite placed `position: N` at the document-type root (outside `properties`). This key is only valid inside property definitions — it's how DPP orders fields in the serialized document row, not a document-type-level config. The v0 document meta-schema silently accepted stray root-level keys because `additionalProperties` was unconstrained. PR #3475 (merged 2026-04-12, gated on protocol v12) added `additionalProperties: false` to the v1 meta-schema, which correctly rejects the stray `position`. Since protocol v12 went live this caused the `Run WASM SDK functional tests` step to fail with: state transition broadcast error: JsonSchemaError: Additional properties are not allowed ('position' was unexpected), path: on contract publish, with cascading `expected null to exist` failures on the 4 downstream tests that depend on the contract being published. Also replace the misleading comment `"Position property is required for document types and their properties"` with an accurate note about where `position` belongs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTest schemas for data contracts are updated to remove Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review GateCommit:
|
|
Reviewed AI based PR. |
Issue being fixed or feature implemented
The scheduled
v3.1-dev Testsjob has been failing theRun WASM SDK functional testsstep: run 24641468414, job 72046508655 — 6 failures / 82 passing.What was done?
Removed four stray
position: Nentries placed at the document-type root of the test fixture schemas incontracts.spec.tsanddocuments.spec.ts.positionis only meaningful inside a property definition (to order fields in the serialized document row); it is not a valid document-type-level config key.Also replaced the misleading comment ("Position property is required for document types and their properties") with an accurate note about where
positionbelongs.Root cause
The v0 document meta-schema silently accepted unknown root-level keys because
additionalPropertieswas unconstrained. #3475 (merged 2026-04-12, gated on protocol v12, closing #2703) addedadditionalProperties: falseto the v1 meta-schema. With v12 live, these stray keys are correctly rejected and fail the test fixtures:Four of the six failures were cascading
expected null to existassertions in tests (contractUpdate,documentReplace,documentDelete,documentTransfer) that all depend on the contract publish succeeding first.How Has This Been Tested?
position:lines in the changed files are at the property level (14-space indent), not the document-type root (10-space indent).packages/wasm-sdk/tests/unit/fixtures/*.tswere audited and already placepositioncorrectly insideproperties.*.Breaking Changes
None — test-only change.
Checklist:
Summary by CodeRabbit