fix: warn on hub sync and replication failures#101
Open
nanookclaw wants to merge 1 commit into
Open
Conversation
Signed-off-by: Nanook <nanookclaw@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #100.
Summary
This keeps hubsync and replication best-effort, but stops real failure paths from being indistinguishable from “nothing new.”
hubsync.Syncnow warns throughinternal/log/warn.Warnwhen config load, hub dial, sync RPC, or write-to-disk fails, while still returning an empty string so session start is never blocked. Successful zero-entry syncs remain quiet.The replication loop now warns on dial, stream open, send, close-send, receive, and append failures. EOF remains a normal quiet termination. Append failures are reported without aborting the receive loop, so one failed local write does not prevent later entries from being consumed.
Focused regression coverage captures hubsync load/dial warnings and the replication dial-warning path. The warning strings are centralized in
internal/config/warnbecauseinternal/auditrejects production magic strings.Validation
ctx system bootstrapGOTOOLCHAIN=go1.26.3 go test ./internal/cli/system/core/hubsync -count=1GOTOOLCHAIN=go1.26.3 go test ./internal/hub -count=1GOTOOLCHAIN=go1.26.3 go test ./internal/audit -count=1PATH="/tmp/ctx-agent-bin:$PATH" GOTOOLCHAIN=go1.26.3 go test ./...git diff --cached --check