Skip to content

test: cover malformed query cache fallback#261

Open
attaboy11 wants to merge 1 commit into
outerbase:mainfrom
attaboy11:attaboy11-cache-invalid-json-coverage
Open

test: cover malformed query cache fallback#261
attaboy11 wants to merge 1 commit into
outerbase:mainfrom
attaboy11:attaboy11-cache-invalid-json-coverage

Conversation

@attaboy11
Copy link
Copy Markdown

Summary

  • Treat a fresh cache row with malformed JSON as a cache miss instead of throwing out of beforeQueryCache.
  • Log the parse failure so corrupt cache rows remain diagnosable.
  • Add focused Vitest coverage for the malformed cached-result path in src/cache/index.test.ts.

/claim #71

Validation

  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec vitest run src/cache/index.test.ts -> 15 tests passed
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec vitest run src/cache/index.test.ts --coverage.enabled true --coverage.include src/cache/index.ts --coverage.reporter text --coverage.thresholds.lines=0 --coverage.thresholds.branches=0 --coverage.thresholds.functions=0 --coverage.thresholds.statements=0 -> passed; src/cache/index.ts at 89.79% statements / 81.39% branches / 100% functions / 88.88% lines
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec prettier --check src/cache/index.ts src/cache/index.test.ts -> passed
  • git diff --check -> passed

Notes

  • Full suite still has the existing unrelated RLS failures in src/rls/index.test.ts (4 failing assertions); src/cache/index.test.ts passes within that run.
  • No UI demo video is included because this is a backend/unit-test-only cache coverage change with no visible UI surface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant