• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GeorgeSG / KoInsight
56%

Build:
DEFAULT BRANCH: master
Repo Added 24 May 2025 09:56AM UTC
Files 39
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 1-make-duration-rendering-max-in-hoursminutes-instead-of-days
  • UIVersion
  • add-coveralls
  • aggressive-suspend-sync
  • bulk-sync
  • feat/quick-action
  • fix/const-resolution
  • gg/fix-docker-build
  • gg/improve-annotations
  • gg/improve-seeds
  • gg/revert-annotations-change
  • harden-sync
  • master
  • patch/max-upload-size
  • stylua
  • sync-highlights

02 Mar 2026 03:26PM UTC coverage: 56.065% (+2.3%) from 53.749%
22582769013

push

github

web-flow
Harden sync (#99)

Fix last_open corruption, data loss, and edge case crashes

## Problems

### Main bugs

Several bugs were causing incorrect or missing data after syncing:

- "56 years ago" last open date: the annotation sync path read
summary.modified (an ISO date string like "2024-11-30") as the last_open
timestamp. SQLite coerced it to 0, making every book appear last opened
at Unix epoch (1970)
- Last open date on bulk sync: after fixing the above, os.time() was
used as a fallback — but the sidecar contains no reliable last-open
timestamp at all. This caused every bulk-synced book to be stamped with
the sync time instead of the actual last open date
- Silent data loss on manual sync: KoReader buffers reading session
stats in memory and only flushes to disk every ~50 page turns.
Triggering a sync mid-session meant the current session's data was never
captured. Sync-on-suspend was unaffected because the suspend event chain
flushed to statistics.sqlite3 beforehand

### Captured along the way

- In valid page stats reaching the DB: no server-side validation on
duration or total_pages fields, allowing null/NaN/zero values to be
inserted
- Server error on annotation-only sync: the plugin sends stats = {}
(empty Lua table → JSON object {}) on the annotation-only path (simplest
option is sending one data strucutre server-side). Calling .filter() on
a plain object threw TypeError, returning HTTP 500
- "NaN" avg. daily reading time: possible division by zero on the book
detail page when a book had no recorded reading days yet.
- Infinity started-reading date: getStartedReading() returned Infinity
for books with no page stats, which could propagate to the client

## Solutions

- Plugin: Set last_open = 0 in the annotation sync path. The sidecar
file contains no reliable last-open timestamp, and the statistics sync
path already sets this correctly. The server-side guard skips merging
zero values, so this is safe.
- Plugin: call ReaderStatistics:insertDB() b... (continued)

175 of 308 branches covered (56.82%)

Branch coverage included in aggregate %.

10 of 10 new or added lines in 2 files covered. (100.0%)

412 of 739 relevant lines covered (55.75%)

11.66 hits per line

Relevant lines Covered
Build:
Build:
739 RELEVANT LINES 412 COVERED LINES
11.66 HITS PER LINE
Source Files on master
  • Tree
  • List 39
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
22582769013 master Harden sync (#99) Fix last_open corruption, data loss, and edge case crashes ## Problems ### Main bugs Several bugs were causing incorrect or missing data after syncing: - "56 years ago" last open date: the annotation sync path read summary.m... push 02 Mar 2026 03:27PM UTC web-flow github
56.06
22545155932 harden-sync Merge 6d4a17d55 into 86e740db6 Pull #99 01 Mar 2026 02:13PM UTC web-flow github
56.06
22482883622 harden-sync Merge ee48853cc into 86e740db6 Pull #99 28 Feb 2026 12:30PM UTC web-flow github
56.0
21561280025 master feat(koplugin): bulk sync annotations (#84) ### New Features Bulk Annotation Sync: The "Synchronize data" button now syncs all annotations from all books in your reading history at once (previously only the currently open book). Sync on suspend ... push 01 Feb 2026 10:28AM UTC web-flow github
53.75
21561223397 bulk-sync Merge 683c16a41 into 1eb7dcd17 Pull #84 01 Feb 2026 10:24AM UTC web-flow github
53.94
21528873936 bulk-sync Merge 8607f6d69 into 1eb7dcd17 Pull #84 30 Jan 2026 08:00PM UTC web-flow github
53.68
21527943199 bulk-sync Merge 411c5e9a2 into 1eb7dcd17 Pull #84 30 Jan 2026 07:26PM UTC web-flow github
53.68
21527802078 bulk-sync Merge 5df4c0017 into 1eb7dcd17 Pull #84 30 Jan 2026 07:21PM UTC web-flow github
53.68
21525635424 bulk-sync Merge 65d17c5c9 into 1eb7dcd17 Pull #84 30 Jan 2026 06:03PM UTC web-flow github
53.68
21525421597 bulk-sync Merge 0912bb40a into 1eb7dcd17 Pull #84 30 Jan 2026 05:55PM UTC web-flow github
53.68
See All Builds (93)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc