feat: clearer open-error for a valid-but-unsupported SQLite database - #54
Merged
Conversation
A valid SQLite .db that isn't a supported thumbnail cache (e.g. a media- library index with no image BLOBs) now shows a "SQLite database, not a thumbnail cache" headline instead of the generic "unsupported file" one. Detection was already correct; only the user-facing raw message and the renderer's friendlyError headline needed to say so. Adds a SFW synthetic sample (sample/media-index.db) and an e2e rejection case that drives the real app, plus a node --test contract locking the thrown message to the renderer headline. Refs #53 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the user-facing error experience when opening a valid SQLite .db that is not a supported thumbnail cache, so users see an explicit “SQLite database” headline instead of the generic unsupported-file fallback. It updates the core error string thrown for unsupported SQLite schemas and adds both fast-tier and e2e coverage to prevent message-to-headline drift.
Changes:
- Introduces a dedicated “SQLite database – not a thumbnail cache…” headline in
friendlyError()and aligns the core thrown message to include the “SQLite database” signal. - Adds a node-tier contract test to ensure the real thrown SQLite rejection message continues to map to the SQLite-specific headline.
- Adds an e2e assertion for the error banner via a new
data-testid, verifying the SQLite-specific headline and an empty grid.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/lib/errors.ts | Adds SQLite-specific mapping in friendlyError() to avoid the generic unsupported fallback. |
| src/renderer/src/lib/errors.test.ts | Adds unit coverage ensuring SQLite-mentioning raw text maps to the SQLite headline. |
| src/renderer/src/App.tsx | Adds data-testid="open-error" to make the open-error banner reliably selectable in e2e tests. |
| src/core/photothumb.ts | Defines and uses UNSUPPORTED_SQLITE_MESSAGE for unsupported SQLite schema cases. |
| src/core/photothumb.test.ts | Adds a contract test asserting the real unsupported-SQLite message maps to the SQLite headline. |
| e2e/specs/formats.spec.ts | Adds an e2e scenario asserting SQLite DB rejection uses the SQLite headline and renders no grid. |
| CHANGELOG.md | Documents the improved messaging for unsupported SQLite .db opens. |
4 tasks
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.
Description
.dbis not unique to Thumbs.db. When a user opens a valid SQLite database that isn't a supported thumbnail cache (e.g. a media-library index with no image BLOBs), Thumbscope now shows a clear "SQLite database, not a thumbnail cache" headline instead of the generic "Unsupported file" one. Detection was already correct - the file is header-matched as SQLite and never sent to the OLE2 parser; only the user-facing raw message and the renderer'sfriendlyErrorheadline needed to say so plainly. Adds a SFW synthetic sample and end-to-end coverage of the rejection.Related issue
[Feature] Clearer open-error for a valid-but-unsupported SQLite .db (+ synthetic sample) (#53)
Type of change
Feature
How has this been tested?
npm test(233 pass, 0 fail) - includes a new node --test contract inphotothumb.test.tsthat runs the real thrownUNSUPPORTED_SQLITE_MESSAGEthroughfriendlyErrorand asserts it maps to the SQLite headline (drift caught at the fast tier, not only e2e), plus the existingfriendlyErrorand photothumb reject cases.npm run typecheckclean across the node, web, and e2e projects.npm run test:e2e -- formats.spec.ts -g media-index- launches the real Electron app against the committedsample/media-index.db, asserts the error banner is visible, contains "SQLite database", is not the generic "Unsupported file" fallback, and renders no grid.npm run cli -- list sample/media-index.dbprints the new raw message.Checklist
npm testandnpm run typecheckpassCHANGELOG.md## [Unreleased]entry (user-facing change) or n/a (internal-only)