Repository navigation
fix(backend): preserve mock database read errors - #2048
Draft
woahwhattheheck wants to merge 1 commit into
Draft
woahwhattheheck wants to merge 1 commit into
woahwhattheheck wants to merge 1 commit into
Conversation
|
@woahwhattheheck is attempting to deploy a commit to the 1nonly's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1934.
Only a missing mock database file now returns fresh empty collections. Invalid JSON and filesystem errors produce a content-free diagnostic through the existing logger and reject with the original error, instead of appearing to be an empty database. Valid record normalization and the existing write queue are preserved.
Adds four focused Vitest regressions for missing files, corrupted JSON, permission errors and valid records.
Current project validation on the exact submitted source: Node20.20.2, pnpm9.0.0, Vitest2.1.9, the unchanged project configuration/setup and default jsdom29.1.1 environment. All four focused regressions pass. Replacing only production mockDb.ts with the exact master preimage reproduces three failures and one pass; restoring the submitted postimage returns four passes. V8 coverage hits all seven mapped executable statements and all three mapped branch blocks in the changed read/error path (100%). Whole-module coverage is71.11% statements/lines,83.33% branches and50% functions because the unchanged write/reset path is outside this focused suite.
Dependency installation exposed an existing base inconsistency: package.json lists Prettier^3.9.6 but pnpm-lock.yaml omits it, so frozen install rejects the untouched base. For this local focused run only, that unlisted devDependency was temporarily omitted to install the exact existing lock with scripts disabled; package.json was then restored before testing. Source, package and lock readback are clean. No dependency change is included. Full project typecheck/build and hosted CI are not claimed.
Prior independent evidence for the same postimages also covered temporary real files and permission/logger doubles through actual production transpilation (Node22.16.0/TypeScript5.8.3): baseline1pass/3failures to candidate4passes.
Full source and reproducible evidence: https://github.com/woahwhattheheck/bounty-concierge/blob/fa5cb9b191b44af02b4f134a213fe354552151ba/deliveries/commitlabs-1934/ACCEPTANCE.md
Published production blob
fcfbaf841fcb771af87970ae6acc5cd7ce814c00and test blob7be93fd7a6a85097f1c73ca4e65baddbd0278762match that packet exactly. Headcfeb4ffc82faaf5dbeabd3ed40eeefbf170a9632is one commit ahead of current master0d847032ef5862806cbb678f0bca93b6be44fb17; exactly two files (+49/-2).Focused project command:
pnpm exec vitest run src/lib/backend/__tests__/mockDb.test.ts.