Skip to content

sendAnnotationsAsNeeded swallows send exceptions; identification proceeds against unregistered annotations #1714

Description

@JasonWildMe

Found during the investigation for #1710, where it is documented as explicitly out of scope.

Current Behavior

IBEISIA.sendAnnotationsAsNeeded (src/main/java/org/ecocean/identity/IBEISIA.java:3731) wraps its two WBIA sends in a try/catch that converts any failure into a JSON field and returns normally (IBEISIA.java:3766-3772):

try {
    if (!Util.collectionIsEmptyOrNull(masToSend))
        rtn.put("sendMediaAssets", plugin.sendMediaAssets(masToSend, false));
    if (!Util.collectionIsEmptyOrNull(annsToSend))
        rtn.put("sendAnnotations", plugin.sendAnnotations(annsToSend, false, myShepherd));
} catch (Exception ex) {
    rtn.put("sendAnnotMAException", ex.toString());
}

The caller in the identify flow (IBEISIA.java:920) just stores the whole return object into the task results — results.put("sendAnnotationsAsNeeded", sendAnnotationsAsNeeded(allAnns, myShepherd)); — and never inspects sendAnnotMAException. Identification proceeds unconditionally.

So a transient WBIA outage or a failed registration POST during the pre-identify send is recorded as a string nobody reads, and the identify immediately runs against annotations WBIA never received, failing with code 600. Because iaCheckMissing is dead code (companion issue), the job then burns its requeues with no self-heal.

Expected Behavior

A failed pre-identify send should be treated as a failed precondition: either abort/requeue the identify with the send exception as the task error, or retry the send with a bound before proceeding. It should not be possible for the identify to start when the code knows the registration step just threw.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething's broken!

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions