Skip to content

Feature/3711 fieldcapture#340

Merged
chrisala merged 6 commits intodevfrom
feature/3711-fieldcapture
Mar 17, 2026
Merged

Feature/3711 fieldcapture#340
chrisala merged 6 commits intodevfrom
feature/3711-fieldcapture

Conversation

@temi
Copy link
Contributor

@temi temi commented Mar 13, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the file-upload scanning flow so the interceptor can distinguish between “virus detected” (422) and “scan failure” (500), and surfaces those messages in the Knockout file upload UI.

Changes:

  • Change ScanService.isDocumentClean to return the scan HTTP status code (instead of a boolean).
  • Update FileScanInterceptor to reject uploads on 422, allow on all-200, and fail with 500 for other scan outcomes.
  • Update client-side upload failure handling to display server messages for both 422 and 500.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/test/groovy/au/org/ala/merit/FileScanInterceptorSpec.groovy Adjusts mocking setup and adds a new test for scan failure handling (500).
grails-app/services/au/org/ala/ecodata/forms/ScanService.groovy Returns scan HTTP status codes to enable richer interceptor decisions.
grails-app/controllers/au/org/ala/merit/FileScanInterceptor.groovy Implements 422 vs 500 behavior based on scan status codes.
grails-app/assets/javascripts/forms-knockout-bindings.js Displays server-provided error messages for both 422 and 500 upload failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +92 to +94
request.getFileNames() >> ['clean.txt', 'corrupt.txt'].iterator()
request.addFile(cleanFile)
request.addFile(corruptFile)
}

then:
2 * scanService.ecpWebService.postMultipart(*_) >> [statusCode: HttpStatus.INTERNAL_SERVER_ERROR.value()]
temi and others added 3 commits March 16, 2026 09:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@chrisala chrisala merged commit d5391bd into dev Mar 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants