Commit fb06dd3
feat(sync-service): remove subquery feature flags (#4741)
## 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
- [x] `mix format --check-formatted` clean
- [x] `mix compile --warnings-as-errors` clean (confirms no dead clauses
/ unused vars)
- [x] Full suite: **2277 passed, 0 failures**, 25 excluded
- [x] Subquery shape requests succeed without any
`ELECTRIC_FEATURE_FLAGS` set (covered by `serve_shape_plug_test` /
`subqueries_test`)
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/electric-sql/codesmith/electric/pr/4741"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a>
<a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1787816001&installation_model_id=8736&pr_number=4741&repository=electric-sql%2Felectric&return_to=https%3A%2F%2Fgithub.com%2Felectric-sql%2Felectric%2Fpull%2F4741&signature=fd5a7f3eddfda2bf413c9b925e4089a9c54cc35327a5441fe86d84188b5145a3"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need. Autofix is disabled.</sup>
<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ac9fb39 commit fb06dd3
17 files changed
Lines changed: 46 additions & 170 deletions
File tree
- .changeset
- packages
- agents-server
- sync-service
- lib/electric
- shapes
- consumer
- event_handler/subqueries
- subqueries
- test/electric
- plug
- shapes
- consumer/event_handler
- typescript-client/skills/electric-shapes/references
- website/docs/sync
- api
- guides
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | 1029 | | |
1034 | 1030 | | |
1035 | 1031 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 39 | | |
49 | 40 | | |
50 | 41 | | |
| |||
Lines changed: 1 addition & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | | - | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 64 | | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
132 | | - | |
| 130 | + | |
133 | 131 | | |
134 | 132 | | |
135 | 133 | | |
| |||
Lines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | | - | |
17 | | - | |
| 14 | + | |
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | | - | |
26 | | - | |
| 22 | + | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
| |||
32 | 28 | | |
33 | 29 | | |
34 | 30 | | |
35 | | - | |
36 | | - | |
| 31 | + | |
37 | 32 | | |
38 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | 298 | | |
300 | 299 | | |
301 | 300 | | |
| |||
318 | 317 | | |
319 | 318 | | |
320 | 319 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | 320 | | |
331 | 321 | | |
332 | 322 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
| |||
0 commit comments