Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcarle committed Apr 1, 2023
1 parent bb7a722 commit ef651b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 4 additions & 1 deletion core/crdt/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(""))
}

Expand Down
9 changes: 0 additions & 9 deletions db/collection_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -248,8 +246,6 @@ func (c *collection) applyDelete(
)
cids, _, err := headset.List(ctx)
if err != nil {
fmt.Println("headset err")

return err
}

Expand All @@ -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,
Expand Down

0 comments on commit ef651b7

Please sign in to comment.