Skip to content

Fix messages --sync behind live tail - #87

Merged
steipete merged 1 commit into
mainfrom
fix/messages-sync-tail-lock
Jun 10, 2026
Merged

Fix messages --sync behind live tail#87
steipete merged 1 commit into
mainfrom
fix/messages-sync-tail-lock

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Summary

  • Make messages --sync fail fast with an omit---sync hint only when a live tail process owns the sync lock.
  • Keep plain messages as a local read, and treat startup/stale/malformed/legacy lock metadata as an ordinary writer that preserves blocking behavior.
  • Publish active tail ownership only after the Discord gateway opens; clean up owner-token metadata on cancellation/error.
  • Update help/docs/changelog with thanks to @jeanmonet.

Closes #81

Proof

  • go test -count=1 ./...
  • go test -race -count=1 ./internal/cli ./internal/syncer ./internal/discord
  • go vet ./... && go build ./...
  • GOOS=windows go test -c -o /tmp/.../cli.test.exe ./internal/cli
  • Process proof: active tail lock exits 2 with tail already owns live sync; omit --sync while tail is running.
  • Process proof: stale tail-looking metadata without owner token blocks, with no tail-specific hint.
  • Process proof: tail-starting metadata blocks, with no tail-specific hint.
  • $autoreview: clean, no accepted/actionable findings.

@steipete
steipete force-pushed the fix/messages-sync-tail-lock branch from 672675e to d7104b3 Compare June 10, 2026 23:14
@steipete
steipete force-pushed the fix/messages-sync-tail-lock branch from d7104b3 to 1019aa0 Compare June 10, 2026 23:19
@steipete
steipete merged commit 231b650 into main Jun 10, 2026
12 checks passed
@steipete
steipete deleted the fix/messages-sync-tail-lock branch June 10, 2026 23:22
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.

Handle messages --sync when tail already owns the sync lock

1 participant