test(store): drop double-close on raw sqlite handle in legacy-shape test#68
Merged
Merged
Conversation
… test The previous patch (#67) used both `defer db.Close()` and an explicit `db.Close()` to release the writer before opening the reader. That double-closes the handle and can mask the inner-Close error. Drop the defer; the explicit close is required (and now error-checked) so the reader sees a quiesced file. Per Copilot review on #67 (landed after merge).
There was a problem hiding this comment.
Pull request overview
This PR fixes a test-only SQLite lifecycle issue in TestReader_ListReceipts_OutputStatusMismatch_LegacyShape by removing an unintended double-close and ensuring any Close() failure is surfaced.
Changes:
- Remove the deferred
db.Close()that could mask errors and cause a double-close. - Convert the explicit
db.Close()to an error-checked close so failures are reported.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7 tasks
ojongerius
added a commit
that referenced
this pull request
May 22, 2026
CHANGELOG entry for the v0.3.0 cut: brings the dashboard onto sdk/go v0.11.0 (envelope-shape parameters_disclosure per ADR-0012) via #67/#68, and backfills the missing 0.2.x compare links. After merge, push tag v0.3.0 to trigger release.yml → goreleaser → binaries + GitHub Release + homebrew-tap formula update.
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.
Summary
Removes the
defer db.Close()paired with the explicitdb.Close()that landed in #67'sTestReader_ListReceipts_OutputStatusMismatch_LegacyShape. Switches the explicit close to an error-checked form so an inner-Close failure surfaces instead of being silently masked by the deferred one.Why
Copilot review on #67 flagged the double-close after the fix-push but before I had a chance to address it; I merged on CI-green and missed the second-pass review. This is the follow-up.
The explicit close is the load-bearing one — the writer must be quiesced before
OpenReadOnlyopens the file in read-only mode. The defer was redundant safety that just hid Close errors.Test plan
go vet ./...cleango test ./internal/store/ -run LegacyShape -v—TestReader_ListReceipts_OutputStatusMismatch_LegacyShapepassesgo test ./...— all four packages green