Skip to content

fix(offline): preserve downloads when database reads fail - #1331

Merged
everpcpc merged 2 commits into
mainfrom
fix/offline-cleanup-database-errors
Nov 9, 2026
Merged

everpcpc merged 2 commits into
mainfrom
fix/offline-cleanup-database-errors

Conversation

@everpcpc

@everpcpc everpcpc commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Stop orphan cleanup when download statuses cannot be read from GRDB instead of treating the failure as an empty status map.
  • Propagate cleanup failures through the launch, manual cleanup, and sync callers; manual cleanup now surfaces the database error rather than reporting that nothing needs cleaning.
  • Document the invariant that an unreadable download-intent set must never authorize file deletion.

This addresses the deletion path exposed by #1330. The attached log does not include the SQLite failure or the reported sync, so the underlying SQLite error 14 still needs reproduction; this change prevents that database failure from turning valid downloaded books into apparent orphans.

Testing

  • make format
  • make build (iOS, macOS, and tvOS)

Related to #1330

🤖 Generated with Claude Code

@everpcpc
everpcpc merged commit c3fb327 into main Nov 9, 2026
3 checks passed
@everpcpc
everpcpc deleted the fix/offline-cleanup-database-errors branch November 9, 2026 11:16
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.

1 participant