OUT-4068: residual service-branch tests (resync helper, root-move, delta, folder recovery) - #136
Merged
Conversation
Add the untested guard/error legs of the resync retry handlers (cases 132-137), driven via retryFailedSyncsForPortal: - retryDeleteInAssembly / retryDeleteInDropbox: missing-field + already-gone (Copilot 404 / Dropbox 409 path_lookup_not_found) → markDeleted; other → markFailure. - retryCreateInDropbox: missing assemblyFileId/itemPath/channelSync → markFailure; retrieve 404 → markDeleted; still-pending → markFailure. - retryCreateInAssembly + reconcileExistingAssemblyFile: missing fields → markFailure; Dropbox not_found / deleted-tag → markDeleted; non-not_found metadata error → markFailure; recreate on null/404 assemblyFileId; non-404 reconcile error → markFailure; abandoned path nulls assemblyFileId before deleting the stale file (ordering). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- handleDbxRootPathMove: 409 path-gone → re-fetch by dbxRootId, refresh cursor, update the channel map, skip the cycle; non-409 error rethrows, map untouched. (Metadata is injected at the getDropboxFileMetadata seam to skip withRetry's backoff.) - getDropboxChanges: deleted entry with no mapped row / no dbxFileId → dropped; malformed entry → throws; entries scoped to the root path (case-insensitive). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- createAndUploadFileInDropbox: existing file at the path → rename via filesMoveV2 to a timestamped name, then re-upload the new content. - createFolderInAssembly "Folder already exists" catch: row found on re-lookup → stamp only (no recovery); non-matching error → rethrow. - recoverUnmappedAssemblyFolder: match on a later listFiles page (nextToken paging); never-found → log + give up (no insert, no throw). - handleFolderCreatedCase: no-op when not the last folder item. - resyncLeafOnContentChange: recreate carries assemblyPathOverride = existing.assemblyPath. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis test-only PR expands coverage for residual sync-service branches, including resync recovery, Dropbox root moves and delta filtering, folder recovery, and content-change recreation.
Confidence Score: 5/5The PR appears safe to merge because it changes only tests and no concrete test correctness or isolation issue remains. The added tests reach the intended production branches, use the repository’s per-test database and MSW isolation, and introduce no production behavior changes. Important Files Changed
Reviews (1): Last reviewed commit: "test(OUT-4068): cover Dropbox rename + f..." | Re-trigger Greptile |
Rewrite the L3b test/describe titles in plain language and remove the "(case NN)" references to the local scoping catalog (not committed, so meaningless to readers). Labels only — no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What & why
The final ticket of the Unit & Integration test milestone. Covers the residual service branches left after L1/L2/L3a — the ones no happy-path flow reaches and the sibling unit tests only partially exercise. Test-only: no production changes, reuses the existing MSW harness.
Linear: OUT-4068
Coverage (35 new tests)
Resync-helper guard/error branches (
resync-sweep.integration.test.ts, +22) — cases 132–137Root-move + delta (
dropbox-webhook-internals.integration.test.ts, new, +6) — cases 108/109, 114/115/116Sync.service residuals (+7) — cases 46, 79, 84, 85, 86
Notes
getDropboxFileMetadata(its withRetry adds ~20s backoff, impractical through MSW); the 136e ordering test uses a delete-mock that reads the row's liveassemblyFileIdat call-time to prove null-before-delete.Testing
pnpm typecheck✅ ·pnpm lint✅ ·pnpm test→ 203 passed ✅pnpm test:integration→ 170 passed ✅ (was 141; +29)🤖 Generated with Claude Code