@@ -1079,15 +1079,9 @@ defmodule Electric.ShapeCacheTest do
10791079 end
10801080
10811081 test "starts the consumer of a registered dependency shape that has none running" , ctx do
1082- # A dependency (subquery) shape can be registered in ShapeStatus with a
1083- # completed snapshot but no running consumer — e.g. restored on restart
1084- # as a plain shape after its parent was removed (`prune_subquery_shapes/1`
1085- # only matches dependencies through a surviving parent), with consumers
1086- # only started lazily on transaction routing. A new parent then resolves
1087- # its subquery to this handle, and the ShapeCache must start the missing
1088- # consumer before starting the parent — otherwise the parent's materializer
1089- # finds no consumer, the parent is invalidated, and that repeats on every
1090- # retry, since the dependency stays registered.
1082+ # After restart, an orphaned dependency may remain registered with a completed
1083+ # snapshot but no consumer. Reusing it must restart the consumer before the
1084+ # new parent's materializer starts, or the parent is repeatedly invalidated.
10911085 Support.TestUtils . patch_snapshotter ( fn parent ,
10921086 shape_handle ,
10931087 _shape ,
@@ -1109,11 +1103,8 @@ defmodule Electric.ShapeCacheTest do
11091103 ShapeCache . clean_shape ( parent_handle , ctx . stack_id )
11101104 assert_shape_cleanup ( parent_handle )
11111105
1112- # Stop the dependency's consumer with the suspend reason, which
1113- # deregisters it from the ConsumerRegistry without removing the shape —
1114- # the dependency's materializer exits with it. This leaves the exact
1115- # restored-orphan state: registered handle, completed snapshot, no
1116- # consumer process, no materializer.
1106+ # Suspend the dependency without deleting its completed shape, reproducing
1107+ # the post-restart orphan state.
11171108 :ok =
11181109 Electric.Shapes.Consumer . stop (
11191110 ctx . stack_id ,
0 commit comments