Repository navigation
Conversation
Endle
marked this pull request as draft
September 24, 2026 01:57
Contributor
|
Hey, thanks for the change. |
Contributor
|
Alright, just tried with another passage from the same article and this time it worked. The highlight appeared correctly inside Readwise itself, even in the Reader app. |
Owner
Author
|
Hi @Kageetai , thank you so much for your interest. I'm so sorry that I haven't tested it on my own yet. I'll definitely test with real kindle before merging into master |
This was referenced Sep 26, 2026
Endle
force-pushed
the
feat/reader-document-highlights
branch
from
September 26, 2026 19:05
3816c67 to
7ac8f9b
Compare
Endle
force-pushed
the
feat/reader-document-highlights
branch
from
September 26, 2026 19:10
7ac8f9b to
3816c67
Compare
Owner
Author
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.
Highlights exported from downloaded Reader articles currently become separate entries through the Readwise v2 API. This change sends them to Reader's
POST /api/v3/save/with the original document'sparent_idand selected passage, so they attach to that document. Other books retain the existing v2 export.Successful Reader highlight IDs and notes are persisted after each request. Repeated syncs skip unchanged passages, and note edits or removal update the existing highlight. The Reader request helper accepts
201, retains bounded429retries, and avoids automatically retrying a create request after an ambiguous network failure. If parsing or any export fails, sync stops before archive, cleanup, or reconciliation can remove local annotations.The implementation separates HTTP/authentication/retries into
readwisereader/api.luaand highlight payloads/history/note updates intoreadwisereader/highlights.lua.main.luacoordinates KOReader's UI, parsing, settings, and sync, and is 306 lines smaller than before this extraction. The modules receive explicit dependencies instead of the plugin object. API errors are presented by the plugin, token changes take effect on the next request, and each client owns its rate-limit session. Installation instructions now call out copying the entire plugin directory, including these modules.Addresses #20, following the API update reported in this comment. API contract: Reader create/update documentation.
Validation:
git diff --checkpass.Live KOReader/Reader testing has not been performed. Before release, verify text anchoring for selections across paragraphs, styled text, and punctuation. Reader can reject selections that differ from its stored article text. Existing v2 highlights are not migrated; export tracking is local and keyed by document and exact passage. Identical passages share an export record, highlight text changes create a new highlight, and local deletions do not propagate. Resetting settings or losing a create response can allow a later export to be resent. These limits and the behavior of explicit manual archive/delete actions are documented in the README.