Skip to content

fix: meshd watch replays full event history on start#24

Merged
gitcoder89431 merged 1 commit into
mainfrom
fix/watch-event-history-replay
May 26, 2026
Merged

fix: meshd watch replays full event history on start#24
gitcoder89431 merged 1 commit into
mainfrom
fix/watch-event-history-replay

Conversation

@gitcoder89431

Copy link
Copy Markdown
Owner

Problem

meshd watch floods stdout with the entire Syncthing event history on launch — hundreds of connect/disconnect/scan events all with the same timestamp. Makes it unusable as a live event stream.

Root cause

runWatch starts with since := 0, which tells Syncthing "give me all events from the beginning." The MCP server and TUI both call client.InitEventID() before entering their event loops to establish a session baseline — runWatch was missing this call.

Fix

One line: call client.InitEventID() at the top of runWatch, before the --until branch and the streaming loop. Both paths now start from the current event ID.

Before / After

Before: launches and immediately prints hundreds of historical events
After: starts clean, only prints events that occur after launch

🤖 Generated with Claude Code

runWatch started with since=0, causing Syncthing's entire event log to
flood stdout on launch. Call InitEventID() before the event loop to
establish a session baseline, matching how the MCP server and TUI handle
it.

Affects both the streaming mode and --until mode.
@gitcoder89431 gitcoder89431 merged commit 09ef67d into main May 26, 2026
2 checks passed
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