Releases: juice094/syncthing-rust
v0.2.9-rc5 — P0~P2 CRUD repair & E2E validation
v0.2.9-rc5
Highlights
- P0
.stignore目录排除修复:skills/、tools/、ignored/等带斜杠规则现在正确排除目录 - P1 重命名检测 + 本地复制优化:scanner 检测重命名,puller 优先本地复制而非重新下载
- P2
FileInfo字段兼容:modified_by、blocks_hash、no_permissions完整映射 - BEP 桥接修复:
LocalIndexUpdated事件正确转发为IndexUpdate到所有已连接设备 - E2E CRUD 测试:新增 5 个端到端测试(create / modify / delete / rename / stignore),全部通过
Assets
| Platform | Binary | Size |
|---|---|---|
| Windows x64 | syncthing-v0.2.9-rc5-x86_64-pc-windows-msvc.exe |
~13 MB |
| Linux x64 | syncthing-v0.2.9-rc5-x86_64-unknown-linux-gnu |
~14 MB |
Verification
cargo test --workspace # 319 passed, 0 failed
cargo clippy --workspace --all-targets # 0 warningsFull report: docs/reports/CRUD_REPAIR_E2E_2026-05-22.md
syncthing-rust v0.2.8 — Scanner 元数据排除 + CI/文档清理
syncthing-rust v0.2.8
🔧 Fixes
- Scanner 默认排除 syncthing 元数据 (D-1): 自动排除
.stfolder、.stversions、.stignore、config.json、cert.pem、key.pem、db、logs及.syncthing.tmp后缀,防止同步目录与配置目录重合时的递归灾难。 - 修复 pre-existing clippy error (
clippy::only_used_in_recursion). - 修复 6 个 pre-existing rustdoc warnings.
- 修复 CI workflow 中重复的
file-sizejob. cargo fmt --all清理 4 个 pre-existing 格式问题文件.
✅ Verification
- CI 全部 11 个 job 通过(含 Windows Clippy/Test/Release)
- 本地
cargo test --workspace: 309 passed, 0 failed
📦 Assets
| Platform | Binary |
|---|---|
| Windows x64 | syncthing-x86_64-windows.exe |
| Linux x64 | syncthing-x86_64-linux |
Release main
Auto-built from main
v0.2.7 — Windows Block Transfer Fix + Config UX
Bug Fixes: Bug-1 connected_devices empty, Bug-2 double-dot tmp, Bug-3 Scanner paths. New: init wizard, URL addresses, REST hot-add, config validation, single-instance lock. CI: release/doc/e2e checks. Verified: 41 tests pass, WSL2-Windows e2e sync OK.
v0.2.6 — Runtime Safety Hardening + Cross-Version Interop
Releases
v0.2.6 — Runtime Safety Hardening (2026-05-14)
🔒 Security & Stability Hotfix
This is a pure-fix release with zero new features. It addresses the root causes identified in post-incident review INC-20260514-001 (config hot-reload watcher entered a tight loop under notify event storms, producing 21 GB of logs in 19 hours).
Six hardening patches applied (H-1 through H-6):
| Patch | File(s) | What changed |
|---|---|---|
| H-1 | daemon_runner.rs, config.rs |
Config hot-reload now has a 500 ms debounce (resetting timer) and mtime comparison. Hot-reload logs downgraded from info! → debug!. |
| H-2 | main.rs |
Daemon log rotation switched from daily → hourly / 100 MB size cap, preventing single-day log explosion. |
| H-3 | syncthing-net, syncthing-sync, daemon_runner |
All 7 unbounded_channel() sites replaced with bounded channel(1024). Senders use try_send; full queues drop and emit warn!. |
| H-4 | relay_listener, tcp_transport, bep_adapter |
Cleaned up dropped-receiver patterns that leaked memory. |
| H-5 | events.rs, block_cache, derp/server, registry |
All panic! / unreachable!() on external input converted to error! + Err(...). |
| H-6 | daemon_runner, discovery_tasks, relay_listener, events |
Pure interval.tick() loops now have select! { _ = shutdown.changed() => break } for graceful termination. |
🔬 Cross-Version Interoperability Verified
Rust v0.2.6 ↔ Go Syncthing v2.1.0 fully verified on local loopback (2026-05-14):
- TLS 1.3 handshake (
TLS_AES_128_GCM_SHA256) ✅ - BEP Hello exchange ✅
- ClusterConfig exchange ✅
- Index broadcast / receive ✅
- Block Request / Response ✅
- File materialization on receiver ✅
Automation: scripts/cross_version_test.sh (281 lines, Linux/Windows dual-platform).
📊 Quality Metrics
cargo test --workspace → 296 passed, 0 failed, 1 ignored (e2e_sync)
cargo clippy --workspace → 0 warnings (-D warnings)
cargo machete → 0 unused deps (4 removed in this cycle)
criterion benches → 4 skeletons (device_id, scanner, hash_parallel, encode_decode)
📦 Binaries
| Platform | Target | File | Size |
|---|---|---|---|
| Windows | x86_64-pc-windows-msvc | syncthing-v0.2.6-x86_64-pc-windows-msvc.exe |
~12 MB |
| Linux | x86_64-unknown-linux-gnu | syncthing-v0.2.6-x86_64-unknown-linux-gnu |
~11 MB |
| Stress test | x86_64-pc-windows-msvc | stress_test-v0.2.6-x86_64-pc-windows-msvc.exe |
~6.6 MB |
Build from source (any platform with Rust 1.85+):
cargo build --release -p syncthing
⚠️ Known Limitations
- §1 ClusterConfig race: First handshake may stall ~10 s; auto-reconnect succeeds on second cycle. Mitigated by 60 s session health check.
e2e_syncintegration test marked#[ignore]under parallel load. - 72 h endurance: Scripts ready (
scripts/72h_*.sh), Linux deployment pending. - Tailscale field validation: Core discovery integration complete; real-world CGNAT/MTU testing deferred.
🔗 References
- Full incident write-up:
docs/plans/NEXT_STEPS_2026-05-14.md§0 - Known issues registry:
docs/KNOWN_ISSUES.md - Tuning plan:
docs/plans/TUNING_PLAN_2026-05-11.md - Cross-version test script:
scripts/cross_version_test.sh
v0.2.5 — End-to-End sync chain verified
syncthing-rust v0.2.5
Released: 2026-05-13
Codename: "End-to-End"
Theme: 核心 sync 链路打通 + 工程债务清理
🎯 Headline
v0.2.4 把连接层修稳了(9h+ 压测、0 死锁、0 panic);
v0.2.5 把"实际把文件传过去"补完了。
e2e_sync 测试在 12.02s 内完成两节点单文件端到端同步:
TLS → Hello → ClusterConfig → Index → Block → 文件落地
此前一直 #[ignore] 的诊断测试现在是回归套件一员。
🐛 关键修复 — T2.6 (P0)
Runtime-added folders never synchronized
症状:通过 REST API POST /rest/config/folders、TUI、或测试 harness 在
运行时添加的文件夹永不同步——必须重启进程才能生效。
根因:SyncManager::add_folder 创建 FolderModel 但未 spawn
scan/pull/watcher 三个 tokio 任务循环。start_folder_loops() 仅在
SyncManager::start() 时遍历当时已存在的文件夹。运行时新增的 folder
对应的 pull_notify.notify_one() 通知到没有 awaiter 的 Notify,静默丢失。
修复:1 行 — 在 add_folder 末尾无条件调用幂等的 start_folder_internal。
该函数早就有 folder_tasks.contains_key() 检查,调用安全。
验证:
cargo test --test e2e_sync→ 12.02s passed(此前 #[ignore])- 295 unit tests 全过
- 0 clippy warnings
详细 RCA 见 docs/KNOWN_ISSUES.md §2。
🧹 重构 — T2.3 (RFC-001)
service/mod.rs 由 695 行拆分为 60 行 + 4 个职责子模块:
service/
├── mod.rs (60) struct + FolderTaskHandles + mod 声明
├── lifecycle.rs (197) new/with_*/start/stop/run + 内部 helper
├── sync_manager.rs (225) impl SyncManager for SyncService
├── network_bridge.rs (119) BEP 网络层回调
└── sync_model.rs (164) impl SyncModel for SyncService (FFI 边界)
纯位置移动,0 API 变化、0 运行时语义变化。
🛠 工具链 — T2.2
stress_test日志滚动:tracing_appender::rolling每日切片,保留 7 天。
防止多日长跑日志膨胀到 GB 级。新增--log-dir <PATH>CLI 选项。- CSV ISO 8601 时间戳:替换坏掉的
fmt_system_time(产出
"20585T05:07:55Z"这种串),现在 CSV 报告完全可被机器解析。
📚 新增文档
| 文档 | 用途 |
|---|---|
docs/KNOWN_ISSUES.md |
已知缺陷登记 + 修复追溯 |
docs/reports/STRESS_TEST_REPORT_2026-05-13.md |
9h11m 压测分析(暴露 T2.5 缺口) |
docs/operations/TAILSCALE_GUIDE.md |
与 Tailscale 协同部署的 3 条路径 |
docs/operations/PROXY_GUIDE.md |
SOCKS5/HTTP_PROXY 代理使用 |
docs/drafts/RFC-001-service-split.md |
T2.3 拆分架构决策 |
🗂 累计工程清理(Phase A,T1.1–T1.6)
6/6 文件拆分完成。所有原本 > 550 行的核心文件现在都 ≤ 500:
| 原文件 | 拆分后 | Commit |
|---|---|---|
dialer.rs 621 |
mod 452 + tests 168 | 90e6d3b |
block_cache.rs 556 |
mod 322 + tests 234 | 5fd42b0 |
types/mod.rs 639 |
mod 477 + folder.rs 176 | f21c8fe |
daemon_runner.rs 596 |
mod 476 + 2 helpers 176 | 0140851 |
traits.rs 574 |
mod 463 + transport.rs 127 | 66589c2 |
service/mod.rs 695 |
mod 60 + 4 children 705 | T2.3 (this) |
manual_let_else clippy nursery lint 全工程 10 处修复(921cf0f)。
⚠️ 已知限制(未变)
- §1 ClusterConfig 首次握手 10s 超时:首轮连接约 12s(自动重连第二轮兜底)。
- 72h 压测:Windows 桌面 sleep 杀进程,需 Linux 平台重跑。
- Go Syncthing 跨版本互通:仅 2026-04-11 手测一次,无自动化。
📦 二进制下载
| 平台 | 体积 | 文件 | SHA-256 |
|---|---|---|---|
| Windows x86_64 | 12 MB | syncthing-v0.2.5-x86_64-windows.exe |
06b4451c...e9be07 |
| Linux x86_64 | 11 MB | syncthing-v0.2.5-x86_64-linux |
76fcde6c...3ecb2 |
完整 SHA-256(参见随附 SHA256SUMS):
06b4451cfa747c43de3265cb20888797c5e147fcd1eaf437f7c91acbbbe9be07 syncthing-v0.2.5-x86_64-windows.exe
76fcde6cc958fc301b82e445960b7e8e7a3f0801d56348b06cff47d6fad3ecb2 syncthing-v0.2.5-x86_64-linux
二进制为 release 优化,无运行时依赖(OpenSSL、libc 由 rustls + 静态链接处理)。
首次运行:
# Windows
.\syncthing-v0.2.5-x86_64-windows.exe tui # 交互式 TUI
.\syncthing-v0.2.5-x86_64-windows.exe run # headless
# Linux
chmod +x syncthing-v0.2.5-x86_64-linux
./syncthing-v0.2.5-x86_64-linux tui默认端口:BEP 22001,REST API 8385。
🔗 链接
- Source: https://github.com/juice094/syncthing-rust
- Changelog: CHANGELOG.md
- Architecture: docs/design/ARCHITECTURE_DECISIONS.md
- Known issues: docs/KNOWN_ISSUES.md
🙏 致谢
T2.6 根因诊断由 BEP bridge harness (T2.5) 触发——没有这个诊断测试,
add_folder spawn 缺失在生产中会一直作为"REST API 加文件夹后必须重启进程"的
偏门怪事存在。
v0.2.4 — Critical Deadlock Fix + Performance Baseline
v0.2.4 — Critical Deadlock Fix + Performance Baseline
13 commits since v0.2.3, headlined by a critical concurrency bug fix that previously made stress tests freeze at ~3 minutes.
🐛 Critical Fix: BEP Race Resolution Deadlock (T-F1)
ConnectionManager::register_connection was holding a DashMap write guard (RefMut) across .await on conn.close(). When multiple connections raced for the same device_id shard (common in BEP incoming/outgoing race), the internal parking_lot::RwLock blocked other tokio workers, eventually freezing the entire runtime at ~T+180s.
Refactoring: Introduced RegisterAction enum to separate decision-making (under lock) from execution (lock released).
Verification:
- All 86
syncthing-netunit tests pass - 72h stress test: previously 100% froze at T+180s → now stable past T+8h at v0.2.4 ship time
- Memory: 12 → 24 MB over 8 hours (~1.5 MB/hr, no leak)
📄 Full RCA: docs/reports/STRESS_TEST_DEATH_INVESTIGATION_2026-05-12.md
🚀 Performance Baseline (T-A1, T-B1)
Complete Criterion benchmarks established as regression baseline:
| Benchmark | Throughput @1 MiB | Notes |
|---|---|---|
| Scanner SHA-256 | 1.49 GiB/s | Hardware SHA limit per core |
| Puller (memory) | 1.46 GiB/s | Equal to scanner, no overhead |
| BEP encode/decode | 507 MiB/s | Prost protobuf |
T-B1 Rayon Validation (20-core machine):
| Size | Serial | Parallel | Speedup |
|---|---|---|---|
| 16 MiB | 2.04 GiB/s | 19.02 GiB/s | 9.32x |
| 64 MiB | 1.96 GiB/s | 20.69 GiB/s | 10.56x |
| 256 MiB | 2.01 GiB/s | 23.17 GiB/s | 11.51x |
Near-linear scaling confirms rayon parallelization is essential and well-implemented.
📄 Full data: docs/reports/BASELINE_2026-05-12.md
🛡️ Code Quality (T-F2)
- Unwrap audit complete: Production code has zero
.unwrap(), only 15 documented.expect("invariant")calls remain. - Runtime panic risks fixed:
parse().unwrap()for"0.0.0.0:0"→SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), 0)constructorrelay_url.as_ref().unwrap()→let Some(...) else continuepatternTcpTransport::start()double-call panic →SyncthingError::config(...)Resultstore.rszero-capacity panic →cache_capacity.max(1)
📄 Audit: docs/reports/UNWRAP_AUDIT_2026-05-12.md
📐 Code Structure (T-E1)
Six 700+ line files split into mod.rs + tests.rs pattern:
messages.rs(910) → 697 + 213types.rs(882) → 805 + 76 + extractedconnection.rs(175) → 639 prodconnection.rs(770) → 695 + 74service.rs(715) → 684 + 30session.rs(979) → 606 + 366
🔄 CI Hardening (T-G2)
- New
bench-smokejob: All benchmarks compile and run smoke-tested per push clippy::await_holding_locklint enabled: Prevents T-F1-class deadlocks at compile time
📄 Lock audit: docs/reports/LOCK_AWAIT_AUDIT_2026-05-12.md
🧹 Dead Code Cleanup
- Removed
ConnectionManager::from_arc()method (28 lines, never called) - Removed
PORT_MAP_SERVICE_TIMEOUTconstant (never used) - Fixed 4
redundant_cloneinstances (EventBus, FolderWatcher, BlockServer) - Fixed 1
redundant_field_nameswarning
Stats
- 295 unit tests passing across 12 crates
- 0 clippy warnings (including new
await_holding_lock) - 0 fmt diffs
- 6 CI jobs all green (fmt, clippy×2, test×2, audit, file-size, bench-smoke)
Stress Test Status @ Release
- Started 2026-05-12 13:07
- Currently T+8h+ (running)
- Target: 72h
- Will publish complete report after test completion
Breaking Changes
None. v0.2.4 is fully backward compatible with v0.2.3.
v0.2.3
What's Changed
🧹 Code Quality
- Workspace-wide formatting: Applied
cargo fmtto 118 Rust source files ensuring consistent style. - Clippy compliance: Auto-fixed 10
collapsible_matchlints in TUI event handling and stress test binary.
🔧 Infrastructure
- CI Matrix: All 7 jobs now pass on both
ubuntu-latestandwindows-latest:- ✅ Formatting
- ✅ Clippy (Ubuntu + Windows)
- ✅ Tests (Ubuntu + Windows) — 308 passed
- ✅ Security Audit (
cargo audit) - ✅ File Size Check (soft limit 600 lines)
📦 v0.2.2 → v0.2.3 Diff
This patch release contains no functional changes; it is a stability guarantee that the repository builds cleanly with zero warnings on both platforms.
Full Changelog: v0.2.2...v0.2.3
v0.2.2
What's Changed
Infrastructure & Quality
- 72h Stress Test Infrastructure:
stress_testbinary now supports unattended Windows execution with Scheduled Task auto-resume (fault injection every 30 min, file injection every 5 min). Seescripts/register-stress-task.ps1. - GitHub Community Health: Added
.github/ISSUE_TEMPLATE/,.github/PULL_REQUEST_TEMPLATE.md,CODE_OF_CONDUCT.md. - CI Matrix Upgrade: GitHub Actions now runs
fmt,clippy,test,audit, andfile-sizechecks in parallel acrossubuntu-latestandwindows-latest. - README Maintenance: Fixed stale "72h not started" status, removed encoding artifacts, added Stress Test quick-start block.
Documentation
- Tuning plan published:
docs/plans/TUNING_PLAN_2026-05-11.md— cross-cut performance / stability / architecture-debt roadmap.
Full Changelog: v0.2.1...v0.2.2
v0.2.1 — Block-level concurrency, REST write-path closure, CI health checks
What's Changed
🚀 Performance
- Block-level concurrency: Single-file downloads now pipeline block requests (default 16 concurrent), fixing 15MB file taking ~10min.
- Pre-allocated encoding:
bep-protocolmessage encoder now usesBytesMut::with_capacity(msg.encoded_len()), eliminating realloc hot path.
🛠️ API & Sync
/rest/db/overrideand/rest/db/revertimplemented for ReceiveOnly folders (previously 501 stubs).POST /rest/db/scansubparameter and devicepause/resumebody already active; write-path now fully closed.
🧪 Testing & Quality
- Added 14 new tests (workspace total: 308 passed / 0 failed / 3 ignored).
bep-protocol: ClusterConfig encode/decode roundtrip.syncthing-core: Vector compare/dominates/increment, IndexID roundtrip, FolderSummary sync percent.syncthing-fs:.stignorereal-world scenario audit + documented known gaps.
🔧 Infrastructure
.github/workflows/ci.yml: automated test / clippy / audit / file-size checks on PR and push.scripts/check-health.ps1: local Windows health validation script..github/workflows/release.yml: Windows x64 release binary now built automatically alongside Linux.
📋 Audit & Debt
.cargo/audit.toml: 3 upstream unmaintained deps explicitly accepted with ADR.syncthing-fs/src/ignore.rscoverage audit: ~92% common scenarios covered.
Assets
| File | Platform | Size |
|---|---|---|
syncthing-x86_64-linux |
Linux x64 | ~8 MB |
syncthing-x86_64-windows.exe |
Windows x64 | ~12 MB |
Known Limitations
- Pre-release. 72h stress test delegated to remote peer execution.
.stignoreintermediate double-star (a/**/b) matches single directory level only.- Go Syncthing full interoperability: handshake verified, file-sync pending validation.
Full Changelog: v0.2.0...v0.2.1