Skip to content

Commit

Permalink
Fix ADD operation multi-connector uniqueness check
Browse files Browse the repository at this point in the history
The (correct) tightening up UCF fetchObject method identifiers parameter
to be primary-only in 4896e6c revealed
a bug in ADD operation multi-connector case uniqueness check. It is
now fixed.

This fixes failing TestWriter story test.
  • Loading branch information
mederly committed Nov 8, 2023
1 parent 4896e6c commit 6606b36
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,18 @@ private void checkForAddConflictsForMultiConnectors(OperationResult result)
// that we normally do not need or want.
return;
}
ResourceObjectIdentification.Primary identification =
ResourceObjectIdentification identification =
ResourceObjectIdentification
.fromShadow(ctx.getObjectDefinitionRequired(), shadowClone)
.ensurePrimary();
.fromShadow(ctx.getObjectDefinitionRequired(), shadowClone);

if (identification instanceof ResourceObjectIdentification.Primary primaryIdentification) {
existingObject = readConnector.fetchObject(
primaryIdentification, null, ctx.getUcfExecutionContext(), result);
} else {
LOGGER.trace("No primary identifier present, skipping add conflict check for {}", identification);
existingObject = null;
}

existingObject =
readConnector.fetchObject(identification, null, ctx.getUcfExecutionContext(), result);
} catch (ObjectNotFoundException e) {
// This is OK
result.muteLastSubresultError();
Expand Down

0 comments on commit 6606b36

Please sign in to comment.