From c9c0aceb8afaa09baf04e835018342b65f4bb058 Mon Sep 17 00:00:00 2001 From: Adam Jordens Date: Tue, 25 Jun 2019 19:21:07 -0700 Subject: [PATCH] fix(core): A better case insensitive comparison when bulk loading objects (#551) Previously was using `Timestamped::getId` which may not always return _expected_ lower case `id`. --- .../spinnaker/front50/model/StorageServiceSupport.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/front50-core/src/main/groovy/com/netflix/spinnaker/front50/model/StorageServiceSupport.java b/front50-core/src/main/groovy/com/netflix/spinnaker/front50/model/StorageServiceSupport.java index 9efadbbef..278435bd8 100644 --- a/front50-core/src/main/groovy/com/netflix/spinnaker/front50/model/StorageServiceSupport.java +++ b/front50-core/src/main/groovy/com/netflix/spinnaker/front50/model/StorageServiceSupport.java @@ -362,7 +362,7 @@ private Set fetchAllItems(Set existingItems) { Map objectsById = objects.stream() - .collect(Collectors.toMap(Timestamped::getId, Function.identity(), (o1, o2) -> o1)); + .collect(Collectors.toMap(this::buildObjectKey, Function.identity(), (o1, o2) -> o1)); for (String objectKey : objectKeys) { if (objectsById.containsKey(objectKey)) { @@ -371,6 +371,8 @@ private Set fetchAllItems(Set existingItems) { // equivalent to the NotFoundException handling in the exceptional case below resultMap.remove(keyToId.get(objectKey)); numRemoved.getAndIncrement(); + + log.warn("Unable to find result for {}:{} (filtering!)", objectType, objectKey); } } } catch (UnsupportedOperationException e) {