Skip to content

fix: prevent split offline responses on restore (backport #7767)#7777

Merged
Dhruwang merged 1 commit into
release/4.9from
backport/fix-offline-resume-anchor-4.9
Apr 20, 2026
Merged

fix: prevent split offline responses on restore (backport #7767)#7777
Dhruwang merged 1 commit into
release/4.9from
backport/fix-offline-resume-anchor-4.9

Conversation

@Dhruwang
Copy link
Copy Markdown
Member

Summary

  • Backport of fix: prevent split offline responses on restore #7767 to release/4.9
  • Anchors displayId and responseId back into saved survey progress (IndexedDB) as soon as they are created, closing the race condition where saveSurveyProgress() captures responseId: null before createResponse() completes
  • Recovers a missing responseId from displayId via a new server-side lookup route on restore
  • Falls back to a bootstrap create path that sends the full accumulated response state when recovery fails

Test plan

  • Open a multi-block survey with ?offlineSupport=true, submit Block 1, reload before Block 2 — verify single response (no split)
  • Open survey offline, answer all blocks, switch to Slow 3G, reload mid-sync — verify single response
  • Existing offline-storage, response-queue, survey-state, and api-client tests pass

Note: Excludes the newly added survey.test.tsx integration test from #7767; includes all updated unit tests.

🤖 Generated with Claude Code

)

Backport of #7767 to release/4.9. Anchors displayId and responseId back
into saved survey progress as soon as they are created, recovers a
missing responseId from displayId on restore, and falls back to a
bootstrap create path that uses the full accumulated response state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Dhruwang Dhruwang force-pushed the backport/fix-offline-resume-anchor-4.9 branch from 4f1028b to 60e7c7e Compare April 20, 2026 06:13
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
35.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@Dhruwang Dhruwang merged commit 7f5b2bf into release/4.9 Apr 20, 2026
12 of 13 checks passed
@Dhruwang Dhruwang deleted the backport/fix-offline-resume-anchor-4.9 branch April 20, 2026 06:30
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.

2 participants