Skip to content

Address review feedback from #4051#4646

Merged
robacourt merged 8 commits into
mainfrom
rob/subqueries-feedback
Jun 24, 2026
Merged

Address review feedback from #4051#4646
robacourt merged 8 commits into
mainfrom
rob/subqueries-feedback

Conversation

@robacourt

@robacourt robacourt commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the merged subqueries PR #4051, addressing reviewer (@alco) feedback that came in after merge. Each commit maps 1:1 to a review comment so they can be reviewed independently.

Changes

Commit Review comment
8827e20 Make storage row() type reflect actual value type r3130325864
fd7748e Rename position_info boolean fields to subquery?/negated? r3130956496
91f8f17 Use :ets.lookup_element/3 in get_last_broadcast_lsn r3130990531
dd8cb5c Document self() message sent by subscribe_to_global_lsn_updates r3130996392
82ecbc2 Remove dead :init_consumer handle_continue clause r3131087003
1545bb3 Assert mixed-polarity subquery error message in router test r3131001659
6aa7581 Mark last converted change before reversing r3131488531
2a7fff5 Extract value_tag/3 helper in router test r3131013153

These are internal-only changes (type docs, field renames, a dead-code removal, an ETS lookup simplification, test assertions/helpers, and a list-building cleanup) with no user-facing behavior change, so no changeset is included.

A few comments were discussed and intentionally left unchanged: the Stream.concat suggestion (r3131472813, the accumulated lists are tiny and reverse |> flatten is clearer) and the BETWEEN question (r3131209403, confirmed as an intentional latent-bug fix required by this PR's name-based DNF decomposition / SQL generation).


🤖 Generated with Claude Code

@robacourt robacourt requested a review from alco June 23, 2026 16:40
@robacourt robacourt self-assigned this Jun 23, 2026

@alco alco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

robacourt and others added 8 commits June 24, 2026 13:51
Replace the opaque `@type row :: list()` with a definition that
documents the `[key, tags, json]` shape and element types.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
Both are boolean fields, so use the `?` suffix convention. Renames the
keys across the Decomposer producer and all consumers (DnfPlan,
Querying, Shape, SubqueryIndex) plus tests. The :negated/:positive
polarity atoms, the is_subquery?/1 function, and the is_subquery_shape?
option are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
The existing rescue clause already handles a missing table; lookup_element/3
also raises ArgumentError for a missing key, so it replaces the explicit
case on :ets.lookup/2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
On success the function may send a {:global_last_seen_lsn, lsn} message to
the caller, which callers are expected to handle in handle_info/2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
The {:init_consumer, config} continuation is never dispatched; shape
initialization now happens in the handle_info({:initialize_shape, ...})
clause, which performs the equivalent work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
The 400 response carries a descriptive message under the "where" field;
assert against it so the expected text is documented in the test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
Flatten each conversion into the reverse-order accumulator as it is
produced, so the accumulator head is always the last emitted change.
Marking it before the single Enum.reverse/1 removes the List.flatten/1
pass plus the List.pop_at(-1) + ++ rebuild that mark_last_change/1 did.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
Replace the repeated `:crypto.hash(:md5, stack_id <> handle <> value) |>
Base.encode16(case: :lower)` invocation (12 call sites) with a single
value_tag/3 helper. It independently mirrors
SubqueryTags.make_value_hash_raw/3 so assertions document the expected
wire format rather than reusing the code under test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YnwhDEWjjZhPtUptmDX3L
@robacourt robacourt force-pushed the rob/subqueries-feedback branch from 2a7fff5 to dbccd71 Compare June 24, 2026 12:52
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.67%. Comparing base (121dbe6) to head (dbccd71).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4646      +/-   ##
==========================================
- Coverage   59.70%   59.67%   -0.04%     
==========================================
  Files         385      385              
  Lines       43021    43021              
  Branches    12374    12374              
==========================================
- Hits        25684    25671      -13     
- Misses      17259    17272      +13     
  Partials       78       78              
Flag Coverage Δ
packages/agents 72.64% <ø> (ø)
packages/agents-mcp 77.70% <ø> (ø)
packages/agents-mobile 80.67% <ø> (ø)
packages/agents-runtime 83.44% <ø> (ø)
packages/agents-server 75.47% <ø> (-0.18%) ⬇️
packages/agents-server-ui 8.34% <ø> (ø)
packages/electric-ax 51.06% <ø> (ø)
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/start 82.83% <ø> (ø)
packages/typescript-client 91.83% <ø> (ø)
packages/y-electric 56.05% <ø> (ø)
typescript 59.67% <ø> (-0.04%) ⬇️
unit-tests 59.67% <ø> (-0.04%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@robacourt robacourt merged commit c7b41b6 into main Jun 24, 2026
73 of 75 checks passed
@robacourt robacourt deleted the rob/subqueries-feedback branch June 24, 2026 13:08
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