fix(archive): tolerate task pin sync failures - #3980
Merged
Conversation
Generated-By: PostHog Code Task-Id: 4829266a-889b-49eb-bacd-4c1426b27b2b
|
😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
charlesvien
marked this pull request as ready for review
July 30, 2026 07:00
charlesvien
approved these changes
Jul 30, 2026
Contributor
Prompt To Fix All With AI### Issue 1
packages/core/src/archive/archiveOrchestration.ts:70-75
**Failed pin read breaks rollback**
When reading a pinned task's state fails, `wasPinned` remains false even though the subsequent unpin can succeed. If the archive then fails, rollback skips restoring the pin, leaving the task incorrectly unpinned despite the failed archive.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Fix task archiving when pin sync fails" | Re-trigger Greptile |
Generated-By: PostHog Code Task-Id: 4829266a-889b-49eb-bacd-4c1426b27b2b
tatoalo
enabled auto-merge (squash)
July 30, 2026 07:18
Contributor
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. |
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.
Problem
Task archiving fails when task pin reads or updates fail, affecting both cloud and worktree tasks. Pin synchronization is ancillary and should not prevent an archive from completing.
Changes
I made pin reads and writes best-effort during archive orchestration. When pin state cannot be read, archiving leaves it unchanged so a later archive failure cannot accidentally unpin the task. Failed rollback pin writes are logged without replacing the original archive error.
How did you test this?
pnpm --dir packages/core exec vitest run src/archive/archiveOrchestration.test.ts src/sessions/sessionServiceStopCloudRun.test.tspnpm exec biome check packages/core/src/archive/archiveOrchestration.ts packages/core/src/archive/archiveOrchestration.test.tspnpm --filter @posthog/core... buildpnpm --filter @posthog/core typecheckAutomatic notifications
Created with PostHog Code