The issue was that we were sending must-refetch messages with some of our 400s, although they were unrecoverable and re-fetching would trigger an infinite loop.
I've made the server send 400 errors for the cases where the shape_id and shape_definition do not match, with an explanatory message, and I've made the client terminate when receiving such an error.
As a temporary measure, the error is not thrown into the ether but stored in the ShapeStream (accessible via stream.error).
We have had some discussions with @balegas about making errors more "handleable" by changing our approach to the ShapeStream instantiation. I think this warrants opening a new issue and corresponding PR to discuss more thoroughly.
Fixes https://github.com/electric-sql/electric/issues/1876
The issue was that we were sending
must-refetch
messages with some of our 400s, although they were unrecoverable and re-fetching would trigger an infinite loop.I've made the server send 400 errors for the cases where the
shape_id
andshape_definition
do not match, with an explanatory message, and I've made the client terminate when receiving such an error.As a temporary measure, the error is not thrown into the ether but stored in the
ShapeStream
(accessible viastream.error
).We have had some discussions with @balegas about making errors more "handleable" by changing our approach to the
ShapeStream
instantiation. I think this warrants opening a new issue and corresponding PR to discuss more thoroughly.