From 4532784543ac7dab6d2d1dc0eebaac4f61ed2041 Mon Sep 17 00:00:00 2001 From: Chris Malloy Date: Mon, 15 Jul 2024 19:44:51 -0300 Subject: [PATCH] Don't use +plugin/delta signature tag to mark as completed This will not allow for chaining responses. If you're going to modify the Ref, just remove the plugin/delta tag --- README.md | 2 +- src/main/java/jasper/component/delta/Async.java | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6791c8e4..fe234fb7 100644 --- a/README.md +++ b/README.md @@ -587,7 +587,7 @@ The script should by writing UTF-8 JSON to stdout of the form: These entities will either be created or updated, as necessary. You can use this to mark the input Ref as completed by either: 1. Removing the `plugin/delta` tag -2. Adding the `+plugin/delta` signature tag +2. Adding the `+plugin/error` tag 3. Adding a `+plugin/delta` Plugin response Adding the `+plugin/error` tag will prevent any further processing. Remove the `+plugin/error` tag to retry. diff --git a/src/main/java/jasper/component/delta/Async.java b/src/main/java/jasper/component/delta/Async.java index fcc69004..62ac9c98 100644 --- a/src/main/java/jasper/component/delta/Async.java +++ b/src/main/java/jasper/component/delta/Async.java @@ -23,7 +23,6 @@ import java.time.temporal.ChronoUnit; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; import static jasper.domain.proj.HasOrigin.origin; import static jasper.domain.proj.HasTags.hasMatchingTag; @@ -79,12 +78,7 @@ public void init() { */ String trackingQuery() { if (tags.isEmpty()) return null; - var query = tags - .entrySet() - .stream() - .map(e -> e.getKey() + (isBlank(e.getValue().signature()) ? "" : ":!" + e.getValue().signature())) - .collect(Collectors.joining("|")); - return "!+plugin/error:(" + query + ")"; + return "!+plugin/error:(" + String.join("|", tags.keySet()) + ")"; } @ServiceActivator(inputChannel = "refRxChannel") @@ -98,7 +92,6 @@ public void handleRefUpdate(Message message) { tags.forEach((k, v) -> { if (!hasMatchingTag(ud, k)) return; if (isNotBlank(v.signature())) { - if (hasMatchingTag(ud, v.signature())) return; var ref = refRepository.findOneByUrlAndOrigin(ud.getUrl(), ud.getOrigin()) .orElse(null); // TODO: Only check plugin responses in the same origin