Skip to content

feat(sync-service): remove subquery feature flags - #4741

Open
robacourt wants to merge 2 commits into
mainfrom
rob/remove-subquery-flags
Open

feat(sync-service): remove subquery feature flags#4741
robacourt wants to merge 2 commits into
mainfrom
rob/remove-subquery-flags

Conversation

@robacourt

@robacourt robacourt commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Subqueries in shape WHERE clauses are now permanently enabled and treated as a generally-available feature. This removes the two gating flags — allow_subqueries and tagged_subqueries — so there is no way to turn subqueries off, and cleans up the code that only existed to support their disabled paths.

Changes

  • config: empty @known_feature_flags and simplify the feature_flags default. The generic ELECTRIC_FEATURE_FLAGS mechanism (env var, parsing, plumbing) is intentionally retained for future flags — it just has no flags defined now.
  • allow_subqueries removal:
    • shape.ex: drop check_feature_flag/2 — subqueries are always allowed.
    • consumer/state.ex: drop the "allow_subqueries" in feature_flags disjunct. Non-subquery shapes keep fragment streaming, matching current production behavior; only shapes with dependencies / inner subquery shapes use full-txn buffering.
  • tagged_subqueries removal — the dependency move policy collapses to always stream:
    • event_handler_builder.ex: remove dependency_move_policy/2.
    • subqueries/shape_info.ex: remove the dependency_move_policy field and type.
    • event_handler/subqueries/steady.ex: remove the :invalidate_on_dependency_move clause that returned {:error, :unsupported_subquery}.
    • consumer.ex: remove the now-unreachable :unsupported_subquery error handler.
  • tests: remove all @tag allow_subqueries: false tags + the setup conditional, strip feature_flags: ["allow_subqueries"] args, and delete the two obsolete invalidate-policy tests.
  • docs: reframe subqueries as GA — remove the "Preview feature" callout and flag wording in shapes.md (section/anchor renamed to #subqueries), collapse the config.md Feature Flags section to a minimal ELECTRIC_FEATURE_FLAGS entry, move subqueries out of "Unsupported" in the client skill, and drop the ELECTRIC_FEATURE_FLAGS line from the agents-server dev compose.

Notes

With the test-env feature_flags default now empty and the allow_subqueries disjunct gone, simple non-subquery shapes exercise fragment streaming by default in tests (matching production) rather than txn-buffering. The full suite passes under that.

Test Plan

  • mix format --check-formatted clean
  • mix compile --warnings-as-errors clean (confirms no dead clauses / unused vars)
  • Full suite: 2277 passed, 0 failures, 25 excluded
  • Subquery shape requests succeed without any ELECTRIC_FEATURE_FLAGS set (covered by serve_shape_plug_test / subqueries_test)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…re flags

Subqueries in shape WHERE clauses (including incremental move handling for
compound AND/OR/NOT expressions) are now permanently enabled. Remove the
`allow_subqueries` and `tagged_subqueries` feature flags and the code that only
existed to support their disabled paths.

- config: empty `@known_feature_flags`; the generic ELECTRIC_FEATURE_FLAGS
  mechanism is retained for future flags but has none defined
- shape: drop `check_feature_flag/2` — subqueries always allowed
- consumer/state: drop the `allow_subqueries` disjunct; non-subquery shapes
  keep fragment streaming (unchanged production behavior)
- dependency move policy collapses to always stream: remove
  `dependency_move_policy` from ShapeInfo/EventHandlerBuilder, the
  `:invalidate_on_dependency_move` clause in Steady, and the now-unreachable
  `:unsupported_subquery` handler in Consumer
- tests: drop `@tag allow_subqueries: false` and `feature_flags` args; remove
  obsolete invalidate-policy tests
- docs: reframe subqueries as GA (no preview/flag language); trim compose env

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Jul 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: ca87c09

@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 4ba5793
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/6a685b4171e99d0008d8f170
😎 Deploy Preview https://deploy-preview-4741--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.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.02%. Comparing base (9175891) to head (ca87c09).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4741      +/-   ##
==========================================
- Coverage   60.06%   60.02%   -0.05%     
==========================================
  Files         397      397              
  Lines       43766    43766              
  Branches    12587    12587              
==========================================
- Hits        26290    26271      -19     
- Misses      17395    17413      +18     
- Partials       81       82       +1     
Flag Coverage Δ
packages/agents 72.64% <ø> (ø)
packages/agents-mcp 77.70% <ø> (ø)
packages/agents-mobile 80.67% <ø> (ø)
packages/agents-runtime 83.72% <ø> (-0.05%) ⬇️
packages/agents-server 75.54% <ø> (-0.13%) ⬇️
packages/agents-server-ui 8.32% <ø> (ø)
packages/electric-ax 51.06% <ø> (ø)
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/start 82.83% <ø> (ø)
packages/typescript-client 91.78% <ø> (-0.12%) ⬇️
packages/y-electric 56.05% <ø> (ø)
typescript 60.02% <ø> (-0.05%) ⬇️
unit-tests 60.02% <ø> (-0.05%) ⬇️

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.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@robacourt robacourt self-assigned this Jul 28, 2026
@robacourt robacourt changed the title feat(sync-service): make subqueries generally available; remove feature flags feat(sync-service): remove subquery feature flags Jul 28, 2026
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.

1 participant