Closed kevin-dp closed 1 week ago
This seems to be the reason for the bug:
Shape.new
loads the column info via the inspector: Inspector.load_column_info
load_column_info
calls fetch this information from ETSThus, we must ensure that the ETS entry is removed when a table is altered.
When we delete a shape we are forgetting to clean up some meta data somewhere because the old schema information re-appears if we later create a new shape for the same table.
To reproduce this problem, first create a table:
Now, fetch the shape (i'm using HTTPie, can be done with curl too):
Ok, we get the shape with the 2 rows. This is fine. Now drop the table:
Now, tell Electric to delete the shape:
Ok, the shape is deleted. Let's recreate the table but with an extra column:
Let's fetch that table:
Now, the returned data is wrong as the rows only include the
c1
column and not thec2
column (also the schema only includesc1
).