Cleanup output#43
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR cleans up CLI sync output and improves resilience when the sync server is unreachable by (a) suppressing noisy automerge-repo connection logs, (b) bounding shutdown to avoid occasional long hangs, and (c) refining sync status reporting to avoid false “SYNCED” claims.
Changes:
- Route automerge-repo logging through
debugby default, with surfacederrorlogs in the main CLI, and suppress benign transport-level uncaught errors/rejections. - Add bounded teardown (
safeShutdown), connection timing (waitForConnection+connectMs), resync de-duplication, and a two-way “synced/pending” verdict. - Add unit + integration tests covering transport error classification, sync verdicts, bounded shutdown, and unreachable-server behavior (including sharded workers).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/unit/sync-helpers.test.ts | Adds offline unit tests for new sync-reliability helpers (transport errors, verdict, resync dedup, bounded shutdown, connection timing). |
| test/integration/resilience.test.ts | Adds a black-box guard ensuring unreachable sync server doesn’t hang, doesn’t claim SYNCED, and doesn’t leak connection logs (main + workers). |
| src/repo.ts | Implements logging routing, bounded shutdown, transport error classification, connection timing, resync de-dup, and “synced vs pending” verdict logic. |
| src/pushwork.ts | Uses bounded shutdown everywhere and attaches connection timing to sync snapshots; reduces redundant sync/resync paths. |
| src/cli.ts | Suppresses benign transport-level uncaught errors/rejections and surfaces automerge-repo error logs via the CLI UI; updates sync reporting (pending/connect). |
| package.json | Bumps Automerge/automerge-repo dependency versions to the latest subduction variants used by this PR. |
| pnpm-lock.yaml | Updates the lockfile to match the bumped Automerge/automerge-repo versions. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Bump to latest subducted am-repo * Don't redundantly resync docs four times on some code paths * Fix benign warning output * Properly format true error output * Haven't been able to reproduce it today, but in theory remove 60s+ hang that happened sometimes
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.
A couple fixes:
SYNCEDwhen it actually synced (currently also says that if there was an error)Formatting
Before 😞
After 🚀