Skip to content

cellsync: a recovering heartbeat that fails is an owed upload - #2643

Merged
AbirAbbas merged 2 commits into
devfrom
fix/recovering-heartbeat-upload-failure
Nov 13, 2026
Merged

AbirAbbas merged 2 commits into
devfrom
fix/recovering-heartbeat-upload-failure

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Fixes a regression from #2381, found by the PR gate on dev's push of 1ddea1b05.

What broke

#2381 made a batcher that is recovering from an unreachable relay renew its hold with a heartbeat before publishing. It returned the heartbeat's error bare. A normal publish wraps every relay-step failure in syncwords.UploadFailure, meaning the turns are durable here and only the upload is owed. So when a quit ran while the relay was down, a confirmed local save was reported as a lost one. TestL4HostedSurfaceQuitWithRelayDownKeepsTheLocalTurns passes at 8f544aa81 (before #2381) and fails at 7b1bea20f (with it).

The fix

The heartbeat is that publish's relay step, so its failure is wrapped the same way. A superseded hold is unchanged: it still resolves into a kept copy.

Verification

  • New TestBatcherRecoveringHeartbeatFailureIsAnOwedUpload (internal/cellsync) fails on dev and passes with the fix.
  • go test -count=1 ./internal/cellsync/ ./internal/syncsetup/ passes.
  • -count=3 of TestL4HostedSurfaceQuitWithRelayDownKeepsTheLocalTurns, TestL4HostedSurfaceQuitPublishesReleasesAndBareLaunchMovesTheChat, TestAppRelayOutageO1O2O3O4O5, TestAppRelayOutageO2CompetingTake and TestAppRelayOutageO3O4StartupRecovery all pass.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits November 13, 2026 18:48
#2381 made a recovering batcher renew its hold before publishing, but
returned the heartbeat's error bare. A quit while the relay was down
therefore reported a confirmed local save as a lost one
(TestL4HostedSurfaceQuitWithRelayDownKeepsTheLocalTurns). The heartbeat is
that publish's relay step, so its failure is now wrapped as the same owed
upload a failed advance reports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AbirAbbas
AbirAbbas merged commit 6a5f287 into dev Nov 13, 2026
6 checks passed
@AbirAbbas
AbirAbbas deleted the fix/recovering-heartbeat-upload-failure branch November 13, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant