OUT-4066: service-branch tests for sync error-shape edges - #135
Merged
Conversation
Teach the delete MSW mocks (mockDropboxDeleteFile / mockCopilotDeleteFile) to return error responses, then assert the service-branch edges: - createAndUploadFileInDropbox dead-ends (unexpected tag, out-of-range type) surface as a throw via completePendingDropboxCreate. - deleteDropboxFileQuietly swallows 409 path_lookup/not_found, rethrows others. - deleteAssemblyFileQuietly swallows Copilot 404, rethrows others. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 800ms ping-pong guard runs before processing (even for skipped events). - A create for an already soft-deleted file is skipped because the existingFile lookup intentionally omits the deletedAt filter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- retryFailedSyncsForPortal returns early (no rows touched) when the portal has no Dropbox connection. - An unrecognised (action, target) combo is caught per-row and recorded as a failure rather than aborting the sweep. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryAdds integration coverage for defensive synchronization branches without changing production code.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The changes are test-only, and the new fixtures, mocks, seeded states, public entry points, and assertions align with the production branches they are intended to cover. Important Files Changed
Reviews (1): Last reviewed commit: "test(OUT-4066): cover resync missing-con..." | Re-trigger Greptile |
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.
What & why
Adds integration tests for the residual defensive / error-shape branches that a happy-path flow never hits — precise external-error handling, create-vs-update dead-ends, webhook controller guards, and resync-helper edges. Real Postgres + MSW, single service, no task orchestration. Test-only: no production changes.
Linear: OUT-4066
Coverage (10 new tests)
Dropbox create + quiet-delete (
sync-error-shape.integration.test.ts, new)createAndUploadFileInDropboxdead-ends — existing item with an unexpected tag, and out-of-range file type — surface as a throw viacompletePendingDropboxCreate.deleteDropboxFileQuietlyswallows a 409path_lookup/not_found, rethrows any other error (→markFailure+ rethrow).deleteAssemblyFileQuietlyswallows a Copilot 404, rethrows others.Assembly webhook controller (+2)
existingFilelookup intentionally omits thedeletedAt IS NULLfilter.Resync sweep (+2)
retryFailedSyncsForPortalreturns early (no rows touched) when the portal has no Dropbox connection.(action, target)combo is caught per-row and recorded as a failure rather than aborting the sweep.Harness
One shared change: the delete MSW mocks (
mockDropboxDeleteFile/mockCopilotDeleteFile) now optionally return an error response (backward-compatible — existing callers pass no args).Scoped out (per design)
Branches already covered by the flow tests (not_found→create, webhook status/eventType/create-gate/update/delete guards, resync per-row isolation). No extraction — these are I/O error branches tested through public entry points.
Testing
pnpm typecheck✅ ·pnpm lint✅ ·pnpm test→ 197 passed ✅pnpm test:integration→ 141 passed ✅ (was 131; +10 new)🤖 Generated with Claude Code