Closed kevin-dp closed 2 months ago
Shapes with a where clause must include a where clause across all requests, otherwise they are treated as requests for a different shape definition (i.e. the one without a where clause). This is what's happening here, you can see that the response to the first request with offset==0_0
has a different shape id in the response than in the request. I think that's an API deficiency - we should catch that or rethink the url structure - but it behaves correctly given current spec
I would suggest that if the shape_id
is provided and exists then it should be validated as matching the shape definition and if not the request should return 400
.
I agree we should validate that shape_id must match the rest of the URl structure.
I'll create a new issue for that.
When a transaction inserts several rows that are partitioned over several shapes, those shapes fail to pick up the newly inserted rows.
Reproduction
Start Electric:
Connect to Postgres and create a table:
Now, get a shape that fetches all rows where
a > 2
(i'm using HTTPie here):This works fine, the result is:
Now, let's insert some more rows into the table:
Now, let's fetch the shape again from the last offset we know:
Now Electric replies with:
**This is wrong. We were expecting to get the 2 rows we inserted.
Now insert some more rows:
And fetch again:
We see the inserted rows: