Skip to content

Fix read state in the offline mark queue - #37

Merged
bardesss merged 17 commits into
mainfrom
fix/review-phase-2
Nov 13, 2026
Merged

bardesss merged 17 commits into
mainfrom
fix/review-phase-2

Conversation

@bardesss

@bardesss bardesss commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Read-state fixes in the offline mark queue and sync. Stacked on #36; merge that first.

Queue

  • A mark-all now takes over the pending read marks it covers (same feeds, published at or before its cutoff). Marking one of those items unread afterwards queues a real unread mark. It no longer cancels the read mark and leaves the server with the item read.
  • PendingMarkEntity gets an attempted flag (DB version 4, auto-migration, 4.json committed). The flush sets it before sending. A reversal cancels only a row that was never attempted, so a send that timed out after reaching the server is corrected instead of lost. The flag survives when a row is replaced.
  • A mark-all the server rejects with a 4xx (other than 401, 403, 408 and 429) is dropped, so it no longer blocks every item mark behind it. 5xx, 408 and 429 keep it queued.

API and sync

  • The edit token is fetched again on 400 and 403, as well as on 401, once per call.
  • Paging stops when a page adds no new id or repeats its continuation. That fetch counts as incomplete.
  • A flush-only job returns retry() with exponential backoff from 30 s, up to 5 attempts, while marks stay queued.
  • unreadIds for folders with more than 500 feeds reads all unread rows and filters them, keeping the order, instead of going over SQLite's argument limit.

One commit adds a publish-time window for marking items read on a capped refresh, and a later commit reverts it. Servers sort the unread listing by fetch time, not publish time, so that window could mark items read that are still unread.

Tests: MarkQueueTest, MigrationTest (3 to 4), GReaderApiTest, SyncEngineTest, SyncWorkerTest, ItemDaoTest. Full unit tests and lint pass.

Base automatically changed from fix/review-phase-1 to main November 13, 2026 04:06
@bardesss
bardesss merged commit 72c5e95 into main Nov 13, 2026
1 check passed
@bardesss
bardesss deleted the fix/review-phase-2 branch November 13, 2026 04:07
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