appview/labels: reduce the opset after validation #605

merged
opened by oppi.li targeting master from push-plpuqtyrprou

validation also performs a transformation upon labels: it resolves handles to DIDs, it is important that this transform be present when determining redundant ops.

Signed-off-by: oppiliappan me@oppi.li

Changed files
+3 -3
appview
labels
+3 -3
appview/labels/labels.go
···
}
}
-
// reduce the opset
-
labelOps = models.ReduceLabelOps(labelOps)
-
for i := range labelOps {
def := actx.Defs[labelOps[i].OperandKey]
if err := l.validator.ValidateLabelOp(def, repo, &labelOps[i]); err != nil {
···
}
}
+
// reduce the opset
+
labelOps = models.ReduceLabelOps(labelOps)
+
// next, apply all ops introduced in this request and filter out ones that are no-ops
validLabelOps := labelOps[:0]
for _, op := range labelOps {