Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: keep reading bookmarks bound to route#92

Open
kuyua9 wants to merge 1 commit into
datawhalechina:mainfrom
kuyua9:fix/reading-bookmark-route-save-kuyua9
Open

fix: keep reading bookmarks bound to route#92
kuyua9 wants to merge 1 commit into
datawhalechina:mainfrom
kuyua9:fix/reading-bookmark-route-save-kuyua9

Conversation

@kuyua9
Copy link
Copy Markdown

@kuyua9 kuyua9 commented May 12, 2026

Summary

  • keep delayed reading bookmark saves bound to the route that scheduled them
  • clear pending bookmark save timers on route changes and component unmount
  • add a regression test for a delayed save that should not write into the post-navigation page key

Why

ReadingProgress.vue schedules bookmark writes after scroll/click events. Before this change, the delayed callback computed the bookmark path when the timer fired. If a reader navigated before that timer fired, stale state from the previous page could be saved under the new page path.

Tests

  • node --test docs/.vitepress/theme/utils/readingBookmark.test.js
  • npm run lint (0 errors; existing warnings only)
  • npm run build

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