test(storage): verify image()/file() reject malformed write shapes end-to-end#795
Conversation
…d-to-end Adds integration-style tests exercising the real resolveInput -> validate -> splitColumns pipeline for image()/file() in both db.columns: 'keystone' (multi-column) and default single-column (JSON) modes, pinning the #789 fix as a regression guard against silent data corruption. Closes #790 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q1GQboF8Ym1c4egaAzxkq5
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 81f1520 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Code ReviewOverviewThis PR is purely additive (2 new files, no production code touched): a new integration test file for Code quality & conventions
Minor notes (non-blocking)
Test coverage
RiskNone — no production code changes; this is test-only, matching the patch changeset description. No changes requested. Generated by Claude Code |
Coverage Report for Core Package Coverage (./packages/core)
File CoverageNo changed files found. |
Coverage Report for UI Package Coverage (./packages/ui)
File CoverageNo changed files found. |
Coverage Report for CLI Package Coverage (./packages/cli)
File CoverageNo changed files found. |
Coverage Report for Auth Package Coverage (./packages/auth)
File CoverageNo changed files found. |
Coverage Report for Storage Package Coverage (./packages/storage)
File CoverageNo changed files found. |
Coverage Report for RAG Package Coverage (./packages/rag)
File CoverageNo changed files found. |
Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)
File CoverageNo changed files found. |
Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)
File CoverageNo changed files found. |
Summary
packages/storage/tests/opensaas-image-file-write-validation.test.ts, an integration-style test that exercises the REALimage()/file()field pipeline pieces in the order the Hook Pipeline runs them: fieldresolveInput→ built-in field validation (via the samevalidateWithZodcore'svalidateFieldRuleswraps) →splitColumns.db.columns: 'keystone'(multi-column) mode for bothimage()andfile():{ upload: File }wrapper shape (neither File-like nor already-shaped metadata) now throws a realValidationErrorinstead of being silently split into null/undefined physical columns — and assertssplitColumnsis never reached once validation rejects the value.null, an already-shaped metadata object with no re-upload, and aFile-like value that triggers an upload via a mocked storage provider) all persist correctly with the expected per-part columns.@opensaas/stack-storage(test coverage only, no behavior change).This proves the #789 fix (Hook Pipeline validates a multi-column field's logical value before splitting it) holds end-to-end for the real
image()/file()fields, pinning it as a regression guard in both directions.Test plan
pnpm testpasses inpackages/storage(158/158 tests, including 10 new tests)pnpm lintpasses on the new test filepnpm format/ prettier check passespnpm manypkg fixrun (no changes needed)Closes #790
Generated by Claude Code