Skip to content

Conversation

@KyleAMathews
Copy link
Contributor

Removed the check that prevented requestSnapshot from being called in full mode. It's valid to load subsets while loading the full log, which is necessary for LiveQuery joins with collections using progressive syncMode.

Fixes the error: "Snapshot requests are not supported in full mode, as the consumer is guaranteed to observe all data"

Removed the check that prevented requestSnapshot from being called in
full mode. It's valid to load subsets while loading the full log, which
is necessary for LiveQuery joins with collections using progressive
syncMode.

Fixes the error: "Snapshot requests are not supported in full mode, as
the consumer is guaranteed to observe all data"
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.54%. Comparing base (f41db22) to head (cb91c91).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3436      +/-   ##
==========================================
+ Coverage   69.45%   69.54%   +0.08%     
==========================================
  Files         182      182              
  Lines        9787     9786       -1     
  Branches      356      358       +2     
==========================================
+ Hits         6798     6806       +8     
+ Misses       2987     2978       -9     
  Partials        2        2              
Flag Coverage Δ
elixir 66.51% <ø> (+0.09%) ⬆️
elixir-client 74.47% <ø> (+0.52%) ⬆️
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/typescript-client 93.76% <ø> (+0.08%) ⬆️
packages/y-electric 55.12% <ø> (ø)
postgres-140000 65.28% <ø> (-0.21%) ⬇️
postgres-150000 65.52% <ø> (+0.21%) ⬆️
postgres-170000 65.35% <ø> (-0.05%) ⬇️
postgres-180000 65.45% <ø> (?)
sync-service 65.72% <ø> (+0.05%) ⬆️
typescript 87.18% <ø> (+0.05%) ⬆️
unit-tests 69.54% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 14, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@electric-sql/react@3436
npm i https://pkg.pr.new/@electric-sql/client@3436
npm i https://pkg.pr.new/@electric-sql/y-electric@3436

commit: cb91c91

@kevin-dp
Copy link
Contributor

Should we have an e2e test for this?

@icehaunter
Copy link
Contributor

Out of curiosity, what's the use of a snapshot in a full mode, given the client already holds all the same data?

@KyleAMathews
Copy link
Contributor Author

Added a test to verify that requestSnapshot works correctly when the
shape is in full mode (progressive sync). This test ensures the fix
allows subset loading during progressive sync, which is needed for
LiveQuery joins.
@samwillis
Copy link
Contributor

@KyleAMathews This will not fix the issue with Tanstack DB progressive mode, we need to fix it on the DB side rather than on the Electric Client side.

The electric client ensures that the results of a requestSnapshot call are injected into the shape stream at the point where they are causally correct - this is important for on-demand mode in DB to insure that live updates are applied on top of the snapshot and it does not overwrite newer changes. With this fix the snapshots will still not be injected until the end of the stream, not optimistically as we would like.

The intention of progressive mode is that while the initial sync is happening we use and show snapshots. We need to have a discussion on this mode as currently nothing is applied to the collection until the first up-to-date.

@icehaunter
Copy link
Contributor

@icehaunter for the "progressive mode" https://tanstack.com/blog/tanstack-db-0.5-query-driven-sync#progressive-sync-fast-initial-paint--instant-client-queries

@kevin-dp you mean in the tanstack db repo?

No, I got the general idea, I'm just not sure why additional snapshots are needed on top of already full data. I thought the idea for progressive mode was to only use these subset snapshots, otherwise it seems to make little sense if the client already has all the data. Am I missing something?

@samwillis
Copy link
Contributor

samwillis commented Nov 17, 2025

@icehaunter

I'm just not sure why additional snapshots are needed on top of already full data

DB progressive mode is supposed to show the snapshots before we load all the data. on-demand is working with the new scheme perfectly.

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.

6 participants