Skip to content

Conversation

@icehaunter
Copy link
Contributor

Closes #3330

@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit e1473b8
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/692da1c951be9200083a4573
😎 Deploy Preview https://deploy-preview-3427--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 17, 2025

Open in StackBlitz

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

commit: 90c78c9

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.17%. Comparing base (7bb6910) to head (e1473b8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3427      +/-   ##
==========================================
- Coverage   75.20%   75.17%   -0.04%     
==========================================
  Files          51       51              
  Lines        2743     2743              
  Branches      405      408       +3     
==========================================
- Hits         2063     2062       -1     
- Misses        678      679       +1     
  Partials        2        2              
Flag Coverage Δ
electric-telemetry 22.71% <ø> (ø)
elixir 57.38% <ø> (ø)
elixir-client 73.94% <ø> (ø)
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/typescript-client 92.98% <ø> (-0.09%) ⬇️
packages/y-electric 55.12% <ø> (ø)
typescript 87.39% <ø> (-0.07%) ⬇️
unit-tests 75.17% <ø> (-0.04%) ⬇️

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.

Comment on lines +217 to +219
def increment(%LogOffset{op_offset: :infinity} = log_offset, increment) when increment > 0 do
%{log_offset | tx_offset: 1, op_offset: increment - 1}
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads as ♾️ + 1 = 0, but I'm guessing this is no longer an increment function and something more akin to a next function so perhaps it should be named as such (perhaps keeping and calling the increment for the non infinity case). Also tx_offset gets set to 1 regardless of what it was before, presumably because the assumption is infinity is only on tx_offset 0, so perhaps that should be asserted. Or perhaps this isn't a general function of LogOffset at all and should just be kept in the module where it's used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't mind this too much, but would like to see a doctest for this case in particular

the ♾️ is really just a stand-in for the "supremum" of a given tx_offset, not an actual infinity, so adding one makes sense in that it moves to the next tx_offset. I see the point in calling this next but probably worth doing separately in a single PR.

That being said, I think I would prefer if this was also overspecified to the last_before_real_offsets which has tx_offset of 0 rather than any tx_offset - the only times we use infinity is for the supremum of the virtual offsets (which can move to the real offsets), and the last of the real offsets, which should not move on to the next tx offset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supremium or infinity, they both have the same issue, it's not a real increment. i still think next makes more sense but happy for that to be addressed in a separate PR

Comment on lines +217 to +219
def increment(%LogOffset{op_offset: :infinity} = log_offset, increment) when increment > 0 do
%{log_offset | tx_offset: 1, op_offset: increment - 1}
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't mind this too much, but would like to see a doctest for this case in particular

the ♾️ is really just a stand-in for the "supremum" of a given tx_offset, not an actual infinity, so adding one makes sense in that it moves to the next tx_offset. I see the point in calling this next but probably worth doing separately in a single PR.

That being said, I think I would prefer if this was also overspecified to the last_before_real_offsets which has tx_offset of 0 rather than any tx_offset - the only times we use infinity is for the supremum of the virtual offsets (which can move to the real offsets), and the last of the real offsets, which should not move on to the next tx offset.

Copy link
Contributor

@robacourt robacourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I like the separation of concerns. I have left some comments on naming

@icehaunter icehaunter force-pushed the ilia/pr/rmysvxopsvsz branch 4 times, most recently from 7af481b to 4c05799 Compare November 24, 2025 16:32
@icehaunter icehaunter marked this pull request as ready for review November 24, 2025 16:32
@icehaunter icehaunter force-pushed the ilia/pr/rmysvxopsvsz branch 4 times, most recently from ed304ff to 8245f1f Compare December 1, 2025 14:05
made sure other storages match the behaviour

test fixes

further composite key fixes

fixes for 3-layer shapes

added some unit tests

addressing feedback
@icehaunter icehaunter force-pushed the ilia/pr/rmysvxopsvsz branch from 8245f1f to bda1aa9 Compare December 1, 2025 14:09
@icehaunter icehaunter force-pushed the ilia/pr/rmysvxopsvsz branch from bda1aa9 to e1473b8 Compare December 1, 2025 14:10
@icehaunter icehaunter merged commit 93bdb37 into main Dec 1, 2025
47 checks passed
@icehaunter icehaunter deleted the ilia/pr/rmysvxopsvsz branch December 1, 2025 14:29
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.

Basic move support, with single subquery

4 participants