aw-sync status calls the daemon's live staging db orphaned and safe to delete

未关闭
#887 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@TimeToBuildBob 已经在做这个了。

开始于 2026年11月24日。

  • #897 来自 @TimeToBuildBob —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

Start in aw-sync/src/status.rs around lines 270-320, where the orphaned-database check and its warning text live, then compare with where the daemon stages its db in aw-sync/src/main.rs (~452) and where plain sync writes the 3-level layout in sync_wrapper.rs (155-167). Reproduce with the two-server steps in the issue. Done means status no longer flags this device's own live 2-level db and the wording says "equal or larger". Open PR #897 already targets this, so check it before starting.

由索引模型根据 Issue 内容生成。

描述

aw-sync status (#788) reports the daemon's live staging database as orphaned and tells the user to delete it:

orphaned … safe to delete (Syncthing will propagate the delete)

On master (ea6f09c) the daemon still stages at the 2-level path (aw-sync/src/main.rs ~452); only plain aw-sync sync (host mode, sync_wrapper.rs:155-167) writes the 3-level layout. The comment at aw-sync/src/status.rs:270 assumes the 2-level db is legacy, but it isn't. Deleting it as advised forces a full re-export and propagates the delete to every peer.

The message also says the 3-level entry is "larger" when both files are the same size.

Repro (two servers, shared sync dir $S):

aw-sync --sync-dir $S --port $P sync          # writes the 3-level db
# add an event to the server on $P
timeout 12 aw-sync --sync-dir $S --port $P daemon   # writes the 2-level db
aw-sync --sync-dir $S --port $P status        # warns that $S/<device_id>/sync.db is orphaned and safe to delete

Reproduced twice.

Possible fix in status.rs ~275-320: don't flag this device's own 2-level db while the daemon stages there (check only peers, or compare mtimes), and say "equal or larger". Related: #682 (the two layouts).

主要语言
Rust
星标
322
派生
107
平均合并
2 天 16 小时
30 天内合并 PR
25

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ActivityWatch/aw-server-rust 的其他 Issue

查看 ActivityWatch/aw-server-rust 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。