Skip to content

fix: use nextTick instead of tickAfterNext for highlight rendering#32

Open
lgallard wants to merge 1 commit into
gitalexcampos:masterfrom
lgallard:fix/rendering-and-critical-bugs
Open

fix: use nextTick instead of tickAfterNext for highlight rendering#32
lgallard wants to merge 1 commit into
gitalexcampos:masterfrom
lgallard:fix/rendering-and-critical-bugs

Conversation

@lgallard

@lgallard lgallard commented Mar 17, 2026

Copy link
Copy Markdown

Hey! I was having an issue where highlights wouldn't render after sync — had to resize fonts every time to force a re-render.

I used AI to help me dig into the root cause: tickAfterNext() defers the document reload by two UI cycles, creating a window where KOReader caches stale display state without the new highlights. Switching to nextTick() schedules the reload on the very next cycle, preventing the stale cache.

Test plan

  • Create highlights on Device A, sync to cloud, sync on Device B — highlights should render immediately without font resize
  • Test sync on book open, close, and resume settings

tickAfterNext defers the document reload by two UI cycles, creating a
window where KOReader caches stale display state without the synced
highlights. This required a font resize to force a full re-render.

nextTick schedules the reload on the very next cycle, preventing the
stale cache issue.
@lgallard lgallard force-pushed the fix/rendering-and-critical-bugs branch from d65a2ef to a336f1a Compare March 17, 2026 01:05
@lgallard lgallard changed the title fix: resolve highlight rendering bug and critical issues fix: use nextTick instead of tickAfterNext for highlight rendering Mar 17, 2026
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