diff --git a/core/crdt/composite.go b/core/crdt/composite.go index d59a2d01ef..1e50ebbbf6 100644 --- a/core/crdt/composite.go +++ b/core/crdt/composite.go @@ -149,7 +149,10 @@ func (c CompositeDAG) Set(patch []byte, links []core.DAGLink) *CompositeDAGDelta // If it doesn't, it adds it to the store. func (c CompositeDAG) Merge(ctx context.Context, delta core.Delta, id string) error { if delta.GetStatus().IsDeleted() { - c.store.Put(ctx, c.key.ToPrimaryDataStoreKey().ToDS(), []byte{base.DeletedObjectMarker}) + err := c.store.Put(ctx, c.key.ToPrimaryDataStoreKey().ToDS(), []byte{base.DeletedObjectMarker}) + if err != nil { + return err + } return c.deleteWithPrefix(ctx, c.key.WithValueFlag().WithFieldId("")) } diff --git a/db/collection_delete.go b/db/collection_delete.go index ae1999a9f5..bdbb09a682 100644 --- a/db/collection_delete.go +++ b/db/collection_delete.go @@ -229,14 +229,12 @@ func (c *collection) applyDelete( if !status.IsDeleted() { return NewErrInvalidDeleteStatus(status) } - fmt.Println(key) found, isDeleted, err := c.exists(ctx, txn, key) if err != nil { return err } if !found || isDeleted { - fmt.Println("not found") return client.ErrDocumentNotFound } @@ -248,8 +246,6 @@ func (c *collection) applyDelete( ) cids, _, err := headset.List(ctx) if err != nil { - fmt.Println("headset err") - return err } @@ -271,17 +267,12 @@ func (c *collection) applyDelete( status, ) if err != nil { - fmt.Println("save crdt err") - return err } if c.db.events.Updates.HasValue() { - fmt.Println("before publish") txn.OnSuccess( func() { - fmt.Println("publish") - c.db.events.Updates.Value().Publish( events.Update{ DocKey: key.DocKey,