Skip to content

feat: clearer open-error for a valid-but-unsupported SQLite database - #54

Merged
ivmakk merged 1 commit into
developfrom
feat/53-sqlite-unsupported-sample
Jul 14, 2026
Merged

feat: clearer open-error for a valid-but-unsupported SQLite database#54
ivmakk merged 1 commit into
developfrom
feat/53-sqlite-unsupported-sample

Conversation

@ivmakk

@ivmakk ivmakk commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Description

.db is 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's friendlyError headline 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 in photothumb.test.ts that runs the real thrown UNSUPPORTED_SQLITE_MESSAGE through friendlyError and asserts it maps to the SQLite headline (drift caught at the fast tier, not only e2e), plus the existing friendlyError and photothumb reject cases.
  • npm run typecheck clean across the node, web, and e2e projects.
  • npm run test:e2e -- formats.spec.ts -g media-index - launches the real Electron app against the committed sample/media-index.db, asserts the error banner is visible, contains "SQLite database", is not the generic "Unsupported file" fallback, and renders no grid.
  • CLI cross-check: npm run cli -- list sample/media-index.db prints the new raw message.

Checklist

  • Self-reviewed the diff
  • npm test and npm run typecheck pass
  • Docs updated (README / CLAUDE.md / DESIGN.md) where relevant
  • Added a CHANGELOG.md ## [Unreleased] entry (user-facing change) or n/a (internal-only)
  • No real local paths or PII in tracked files (public repo)

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>
Copilot AI review requested due to automatic review settings July 14, 2026 09:01
@ivmakk ivmakk self-assigned this Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ivmakk
ivmakk merged commit c6f8b10 into develop Jul 14, 2026
8 checks passed
@ivmakk
ivmakk deleted the feat/53-sqlite-unsupported-sample branch July 14, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants