Skip to content

Commit

Permalink
fix: ensure relation destroy ops are sorted
Browse files Browse the repository at this point in the history
As for offers in the prior commit, this ensures that relations can be
forcibly removed without encountering errors based on transaction
operations with removals before updates.
  • Loading branch information
manadart committed Oct 8, 2024
1 parent ff1cdd1 commit 6d716e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion state/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ func (op *DestroyRelationOperation) internalDestroy() (ops []txn.Op, err error)
} else if op.FatalError(err) {
return nil, err
}
return append(ops, destroyOps...), nil

ops = append(ops, destroyOps...)
sortRemoveOpsLast(ops)
return ops, nil
}

// destroyOps returns the operations necessary to destroy the relation, and
Expand Down

0 comments on commit 6d716e4

Please sign in to comment.