Hey, we have a batch of updates that we only want ...
# spicedb
w
Hey, we have a batch of updates that we only want to process if a specific relationship in the batch doesn't already exist. We can get that behavior two ways that we know of (create operation or a precondition), but we want to know if the batch error'd because the relationship was already there (in which case, it's okay) or for another reason (in which case, we have an error.) This may sound like a touch operation, but there's a subtle difference: there are other relationships in the batch that may not exist yet, and we don't want to create them if the aforementioned relationship exists. It looks like a failed precondition gives rich error feedback (a populated ErrorInfo struct with all sorts of goodness), which would serve our purposes, while the create operation is just a grpc server error + human-readable message. I guess two questions: 1) is the difference in error detail intentional (ie: should an application not expect to know that a create operation failed due to the record existing?), and 2) is there a recommended way to approach something like this? Precondition?