Implement Native 2-Way Live Sync with Recursive File Watching#35
Implement Native 2-Way Live Sync with Recursive File Watching#35EdoSag wants to merge 6 commits intoDonnieDice:mainfrom
Conversation
Review Summary by QodoImplement native 2-way live sync with event-driven file watching
WalkthroughsDescription• Implement native event-driven 2-way file sync with recursive filesystem watching • Add sync suppression cache to prevent infinite sync loops between local and remote changes • Introduce four new Tauri commands for sync lifecycle management and remote updates • Modernize base64 API to use base64::Engine for compatibility with current Rust ecosystem • Consolidate command registration into single unified invoke handler block Diagramflowchart LR
A["Local Filesystem Events"] -->|"notify crate watcher"| B["Rust Event Handler"]
B -->|"filter known_files cache"| C["Emit live-sync://local-change"]
C -->|"JS bridge"| D["Frontend Upload Logic"]
E["Remote File Changes"] -->|"JS interceptor"| F["handle_remote_update command"]
F -->|"mark_known_file suppression"| G["Write to Local Folder"]
G -->|"watcher detects event"| H["Cache suppresses echo"]
File Changes1. src-tauri/src/live_sync.rs
|
Code Review by Qodo
1.
|
PR: Harden live 2-way sync: path safety, bounded suppression cache, and safer logging
Summary
This updates the experimental native 2-way sync implementation with security and reliability hardening, while preserving the same cross-package behavior (AUR/AppImage/Flatpak/snap/deb/rpm).
What changed
1) Remote write safety: validate before mutation
create/update, target path validation now executes before any directory/file mutation.2) Bounded ping-pong suppression cache
3) Event emission reliability
emit("live-sync://local-change", ...)failures are now logged explicitly.4) Existing hardening included
notifydependency for native recursive watcher.Files changed
src-tauri/src/live_sync.rssrc-tauri/src/main.rssrc-tauri/Cargo.tomlREADME.mdWhy
This addresses reviewer concerns around:
Notes
cargo checkin my current shell because Rust/Cargo is not installed there."@
$bodyFile = Join-Path $PWD "pr-body.md"
Set-Content -Path $bodyFile -Value $prBody -Encoding UTF8