Skip to content

fix(webdav): preserve reading progress across devices - #24

Merged
luyishui merged 0 commit into
luyishui:mainfrom
kiri603:codex/webdav-reading-progress
Nov 29, 2026
Merged

luyishui merged 0 commit into
luyishui:mainfrom
kiri603:codex/webdav-reading-progress

Conversation

@kiri603

@kiri603 kiri603 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

问题

两台设备交替阅读同一本书时,改排版或打开书也可能更新配置文件时间,使较旧的阅读位置盖过另一台设备上较新的进度。阅读器打开时,已同步到磁盘的新位置也可能被内存中的旧位置写回。

改动

  • 单独记录阅读位置更新时间,兼容只有 updatedAt 的旧配置。同步时按阅读位置的更新时间合并进度。
  • 使用当前设备上次成功同步的指纹判断文件变化。每轮重新探测 JSON,二进制文件仍可使用缓存。
  • 打开阅读器和切换应用时触发同步。上传前保存尚未落盘的新进度,合并后更新打开的阅读器,跳过内容未变的配置写入。

验证

  • 应用全量 Vitest 通过(37 个测试文件,341 项测试),覆盖两端进度合并、同步中继续阅读、位置恢复及跳过无变化写入。
  • TypeScript 检查通过,变更文件通过 ESLint 和 Prettier。
  • 双设备真机验证待补。可在设备 A 读到新位置后切到设备 B,再切回 A,观察位置是否收敛,以及自动保存会不会让进度回退。

@luyishui

Copy link
Copy Markdown
Owner

感谢 @kiri603 的贡献!我们已经把改动整合进当前开发分支,并针对冲突、评审修复和移动端 UI 做了调整。commit 中已通过 Co-authored-by 保留你的署名。这个 PR 暂时先不关闭,感谢!

luyishui added a commit that referenced this pull request Nov 28, 2026
Merge PR #24 and PR #25 with review fixes and regression coverage.

Co-authored-by: kiri603 <212926027+kiri603@users.noreply.github.com>

Refs: #24

Refs: #25
luyishui added a commit that referenced this pull request Nov 28, 2026
PR #24: cross-device reading progress
- merge per-book config with progressUpdatedAt and four-state JSON merge
- add cross-window lease, light tick, applySyncedProgress
- touches WebDavAutoSyncRunner, contentMerge, engine, readerStore, bookDataStore

PR #25: cross-book word notes
- add WordNote/WordNoteTombstone and Settings/word-notes.json
- sync word-notes.json over WebDAV with tombstones
- add notebook/annotator UI and 17 regression tests
- touches wordNotesStore, wordNotesSync, WordNotePopup, useWordNotes

42 files changed.

Refs: #24
Refs: #25
Co-authored-by: kiri603 <212926027+kiri603@users.noreply.github.com>
luyishui added a commit that referenced this pull request Nov 28, 2026
PR #24: cross-device reading progress
- merge per-book config with progressUpdatedAt and four-state JSON merge
- add cross-window lease, light tick, applySyncedProgress
- touches WebDavAutoSyncRunner, contentMerge, engine, readerStore, bookDataStore

PR #25: cross-book word notes
- add WordNote/WordNoteTombstone and Settings/word-notes.json
- sync word-notes.json over WebDAV with tombstones
- add notebook/annotator UI and 17 regression tests
- touches wordNotesStore, wordNotesSync, WordNotePopup, useWordNotes

42 files changed.

Refs: #24
Refs: #25

Co-authored-by: kiri603 <212926027+kiri603@users.noreply.github.com>
@luyishui
luyishui merged commit d8f3973 into luyishui:main Nov 29, 2026
luyishui added a commit that referenced this pull request Nov 29, 2026
- harden device baselines, unverified fingerprints, and remote probing
- add cross-window sync lease and auto-sync policy
- add word-note store, helpers, and UI wiring
- expand regression coverage for progress and word-note sync

38 files changed.

Refs: #24
Refs: #25
@luyishui

luyishui commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

补充更正一下上条留言:之前说“通过 Co-authored-by 保留署名”不够准确。Co-authored-by 会显示在 commit 页面和个人贡献图,但 GitHub 仓库的 Contributors 列表只统计 commit author,不统计 co-author,所以不会出现在仓库贡献者列表里。抱歉。

我们已经调整了合并方式:PR #24 的 5e2752da 和 PR #25 的 c55f7bf1 已作为原始 commit 保留进 main,作者仍是 @kiri603;后续评审修复单独提交。现在仓库 Contributors 已统计到你的 2 个 commit。由于原始 commit 已进入 main,GitHub 已将这两个 PR 标记为 MERGED;感谢!

@luyishui

Copy link
Copy Markdown
Owner

@kiri603 同步一下最终状态:

你的两个 PR 都已经合并进 main:

合并时我们针对冲突、设备同步基线、词条存储和回归测试做了一些 review 修复,这些修复放在单独的 commit 里,没有覆盖你的作者身份。

由于原始 commit 已进入 main,GitHub 自动把这两个 PR 标记为 MERGED,Merged 状态无法再改回 OPEN;如果后续还有问题,直接在这里留言即可。

感谢你的贡献!

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.

2 participants