Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.msg file upload #4961

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

.msg file upload #4961

wants to merge 5 commits into from

Conversation

robinmolen
Copy link
Contributor

Closes #4795

Changes

The sdk cannot determine what content type should be used for .msg files, which results in the content type "". When you try to submit the form, the fileSerializer doesn't recognizes the content type and returns an error.

To allow the submission of .msg files, the content type should be allowed to be empty.

  • Turned type property on FileSerializer optional
  • Added validation for .msg files to the MimeTypeValidator

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@robinmolen robinmolen marked this pull request as draft December 19, 2024 16:40
@robinmolen
Copy link
Contributor Author

The removal of the FileSerializer type blank message conflicts with #4496. Some more work is required to ensure users receive useful error messages, when needed

@robinmolen robinmolen force-pushed the bug/4795-msg-file-upload branch from 6833a2c to 4908172 Compare December 23, 2024 08:58
@robinmolen
Copy link
Contributor Author

The MimeTypeValidator now checks if the file has an extension. If it doesn't, an validation error is raised

The sdk cannot determine which content type belongs to a .msg file. This is because (at least) Linux and MacOS don't know this file type.

To make sure these files can be uploaded, the type property on the FileSerializer is now optional. For .smg files a new rule has been added to the MimeTypeValidator
@robinmolen robinmolen force-pushed the bug/4795-msg-file-upload branch from 4908172 to 2d11d04 Compare December 23, 2024 09:01
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.62%. Comparing base (260a985) to head (5e77364).
Report is 12 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4961   +/-   ##
=======================================
  Coverage   96.62%   96.62%           
=======================================
  Files         760      760           
  Lines       25837    25843    +6     
  Branches     3385     3388    +3     
=======================================
+ Hits        24964    24970    +6     
  Misses        608      608           
  Partials      265      265           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robinmolen robinmolen force-pushed the bug/4795-msg-file-upload branch from 784b49f to cc51188 Compare December 23, 2024 10:44
@robinmolen robinmolen force-pushed the bug/4795-msg-file-upload branch from cc51188 to 5e77364 Compare December 23, 2024 10:50
@robinmolen robinmolen marked this pull request as ready for review December 23, 2024 10:51
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.

.msg files cannot be uploaded
1 participant