Revision caacb1a199d5c593233e424e49d379ba09199eac

Committed on 18/12/2025 9:46 am by Zohaib Sibte Hassan <zohaib@sibte.pk> [GitHub Diff]

Fix: Critical safety fixes and dead code removal

Phase 0 - Safety Fixes:
- Add defer to mutex Lock/Unlock in protocol/server.go (deadlock prevention)
- Add defer to RUnlock in coordinator/handler.go
- Fix file handle leak in grpc/server.go snapshot streaming
- Fix goroutine leak in publisher/worker.go Start/Stop race condition
- Add 30s context timeout in db/sqlite_batch_committer.go

Phase 1 - Dead Code Removal:
- Remove unused CapturedRow struct from db/preupdate_hook.go
- Remove IntentStore interface and IntentMeta struct from db/memory_stores.go
- Remove XsyncIntentStore implementation from db/memory_stores_xsync.go
- Remove IntentStore tests from db/memory_stores_xsync_test.go

Net reduction: ~300 lines removed

???? Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>