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

Input validation before creating an eFormidlings "shipment" #717

Open
SandGrainOne opened this issue Jul 17, 2024 · 2 comments
Open

Input validation before creating an eFormidlings "shipment" #717

SandGrainOne opened this issue Jul 17, 2024 · 2 comments
Assignees
Labels
kind/feature-request New feature or request

Comments

@SandGrainOne
Copy link
Member

SandGrainOne commented Jul 17, 2024

Description

I would like to suggest a small improvement to the eFormidlings client and business logic during the steps right before creating a shipment. The logic would need to look at the instance and its data elements to determine if a shipment can be successfully generated.

The first and most critical validation step would be to check for more than one attachment with the same filename. The integration point for eFormidling gives off an error message and crashes the process if the app is attempting to upload a file with a name that match an earlier upload.

The application owner can add logic like this themselves, but this one example should be built in I think.

Additional Information

I created this issue here in this repo even though I'm not sure exactly who it is that owns the eFormidlings client code. The code is hosted in the altinn-studio repository for the time being. I do assume that this would require some changes in the app lib code as well.

@ivarne
Copy link
Member

ivarne commented Jul 17, 2024

I don't know much about eFormidling, but as far as I can tell this can be stopped at multiple stages.

  • file analyzer/validator that (barring race conditions) prevents a user from uploading duplicate file names.

  • normal task validation that prevents submission of attachments with duplicate file names. (User need to delete and reupload with unique names)

  • logic in the preparation of the message that changes file names to be unique (eg add -1 postfix when required)

  • use the element id (guid) instead of the file name from the upload request.

  • (also suggested) provide a way to make the file names on the instance unique when uploading. This is race condition prone.

@martinothamar martinothamar self-assigned this Sep 4, 2024
@martinothamar
Copy link
Contributor

logic in the preparation of the message that changes file names to be unique (eg add -1 postfix when required)

I think this is the suggestion we're considering. Will investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request New feature or request
Projects
Status: Done
Development

No branches or pull requests

4 participants