Skip to content

DS-8668: adds check for HTTP 413 status code when importing an SAF file#2162

Merged
tdonohue merged 2 commits intoDSpace:mainfrom
TexasDigitalLibrary:DS-8668
Apr 14, 2023
Merged

DS-8668: adds check for HTTP 413 status code when importing an SAF file#2162
tdonohue merged 2 commits intoDSpace:mainfrom
TexasDigitalLibrary:DS-8668

Conversation

@nwoodward
Copy link
Copy Markdown
Contributor

References

Description

This PR adds a check for an HTTP 413 response from the backend when importing an SAF file and displays a different message to the user.

Instructions for Reviewers

  1. Go to /admin/batch-import
  2. Upload an SAF file larger than 512 MB

Checklist

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue added bug tools: import 1 APPROVAL pull request only requires a single approval to merge labels Mar 24, 2023
@tdonohue tdonohue added this to the 7.6 milestone Mar 24, 2023
@tdonohue tdonohue self-requested a review April 6, 2023 14:48
Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @nwoodward ! This looks good to me. I've tested it locally by setting the maximum file size to a very small value & attempting an SAF upload. It works as described & shows a more informative error.

For my tests, I simply set this in my local.cfg:

spring.servlet.multipart.max-file-size = 20KB

With this setting, any SAF ZIP file over 20KB throws the error. Also verified when it's unset or set to a larger value, larger files are accepted.

@tdonohue tdonohue merged commit 548ccf8 into DSpace:main Apr 14, 2023
@nwoodward nwoodward deleted the DS-8668 branch April 18, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug tools: import

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

SAF Import - Batch Import (ZIP) failure due to file size is not clear to end user

2 participants