#2886 Fix to empty zips#2899
Open
hauck-jvsh wants to merge 1 commit into
Open
Conversation
…200 and a new field warnings with the invalid files. This also accepts the current behavior by checking if the error message is "Nenhuma imagem válida encontrada no arquivo ZIP". If this is the case, IPED should not abort, but only marks all the files with classificationFail.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates RemoteImageClassifierTask to better handle batches where the remote classifier returns partial/empty results (including the “no valid images in ZIP” HTTP 400 scenario from #2886), aiming to avoid aborting case processing and to record clearer failure status per evidence.
Changes:
- Logs server-side per-file warnings returned in the JSON response and attempts to map them back to local evidences.
- Marks evidences as
failNoResultswhen the server omits them from theresultsarray (partial/empty result sets). - Treats a specific HTTP 400 “no valid images in ZIP” response as non-fatal, marking the batch as
failNoResultsinstead of aborting.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+416
to
+426
| for (JsonNode warning : warnings) { | ||
| JsonNode filename = warning.get("filename"); | ||
| JsonNode error = warning.get("error"); | ||
| String name = filename.asText(); | ||
| IItem evidence = getEvidenceByServerFilename(name); | ||
| if (evidence != null) { | ||
| logger.warn("ClassificationWarn::ServerWarning: filename: {} path: {} - {}", name, evidence.getPath(), error.asText()); | ||
| } else { | ||
| logger.warn("ClassificationWarn::ServerWarning: filename: {} path: <not found> - {}", name, error.asText()); | ||
| } | ||
| } |
Comment on lines
+429
to
+435
| private IItem getEvidenceByServerFilename(String name) { | ||
| IItem evidence = queue.get(name); | ||
| if (evidence == null && name.split("_").length == 2) { | ||
| evidence = queue.get(name.split("_")[1]); | ||
| } | ||
| return evidence; | ||
| } |
Member
|
@aberenguel, could you help reviewing and testing this fix? PS: Since you tried to fix the same issue a while ago and have knowledge about the issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #2886