Add secure backups and improve PDF hyphen selection - #7
Merged
Conversation
dowellhz
marked this pull request as ready for review
August 13, 2026 17:08
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.
What changed
Why
PDFKit may expose a line-wrapped word either with a newline or as text containing only a layout hyphen. The previous selection path could recover a word when the selected fragment ended in a hyphen, but selecting the suffix on the following line left the prefix undiscovered.
Leaf Reader also lacked a supported way to move or recover vocabulary, learning state, reading notes, note assets, sessions, conversations, and preferences. Copying live WAL files or replacing open databases would risk inconsistent or partial user data, so backups use verified SQLite snapshots and restoration is deferred to cold startup.
Credential availability checks were also reading Keychain during ordinary reader interactions. Credential access is now limited to explicit actions that actually need a secret.
Impact
File > Back Up User Data...and schedule a validated restore fromFile > Restore User Data....Validation
./tests/run.sh— all 154 logic tests passed, including backup round trip, tamper rejection, rollback, interrupted recovery, symlink rejection, credential deferral, and PDF hyphen cases./scripts/check.sh --no-build— all checks passed./scripts/check_ui_theme.sh --warnings-as-errors— passed./scripts/build_app.sh— Debug arm64 app built and passed signing verificationgit diff --check— passed