Patch Changes
-
Allow rows to be deleted by key by using the write function passed to a collection's sync function. (#1003)
-
fix: deleted items not disappearing from live queries with
.limit()(#1044)Fixed a bug where deleting an item from a live query with
.orderBy()and.limit()would not remove it from the query results. ThesubscribeChangescallback would never fire with a delete event.The issue was caused by duplicate inserts reaching the D2 pipeline, which corrupted the multiplicity tracking used by
TopKWithFractionalIndexOperator. A delete would decrement multiplicity from 2 to 1 instead of 1 to 0, so the item remained visible.Fixed by ensuring
sentKeysis updated before callbacks execute (preventing race conditions) and filtering duplicate inserts infilterAndFlipChanges.