fix(client): avoid duplicate subset snapshot prefetch - #4778
Conversation
Snapshot (subset) responses carry a shape handle and offset just like normal chunks, so the prefetcher mistook them for a chunk stream and speculatively re-issued the same subset request, downloading the snapshot twice. Skip prefetch whenever the response is marked with the electric-snapshot header. Fixes #4753
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1ea9cd708
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4778 +/- ##
==========================================
+ Coverage 60.02% 60.09% +0.07%
==========================================
Files 397 397
Lines 43772 43773 +1
Branches 12588 12594 +6
==========================================
+ Hits 26272 26306 +34
+ Misses 17418 17386 -32
+ Partials 82 81 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The subset-snapshot response header was set as a raw string outside of the @electric_headers list that CORSHeaderPlug turns into access-control-expose-headers, so browser clients on a different origin could not read it and the client-side prefetch guard was a no-op for them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFFVFCNmGhPm94KCwK1fg8
|
This PR has been released! 🚀 The following packages include changes from this PR:
Thanks for contributing to Electric! |
Summary
Fixes #4753
Testing