Skip to content

Commit

Permalink
Don't use +plugin/delta signature tag to mark as completed
Browse files Browse the repository at this point in the history
This will not allow for chaining responses. If you're going to modify the
Ref, just remove the plugin/delta tag
  • Loading branch information
cjmalloy committed Jul 15, 2024
1 parent cda70c5 commit 4532784
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 1 addition & 8 deletions src/main/java/jasper/component/delta/Async.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")
Expand All @@ -98,7 +92,6 @@ public void handleRefUpdate(Message<RefDto> 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
Expand Down

0 comments on commit 4532784

Please sign in to comment.