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

Fix Bug: Hitting cancel on cmpdreg file upload widget new line causes "error..." #460

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

hhan-schrodinger
Copy link
Contributor

Description

Original Bug:

To reproduce:

  • Click View/Edit files
  • Upload a new file to the list
  • The UI automatically adds another file chooser below the new file uploaded.
  • Click the "cancel" button on this new file chooser line
  • Click the "Upload" button

Expectation:

  • The file I chose to upload is uploaded

Actual results:

  • "error..." is displayed and the file is not uploaded.

Fix

Narrowed down the issue to this line in FileSaveSendDTO.java:
String writeup = writeupList.get(i);

If the user inserted text (even a blank space) in writeup even if they hit "cancel" on the new file chooser line, there would be no issue BUT if they left the writeup field in the form blank and hit cancel, the writeupList would be blank and the code would fail on this line.

I'm guessing maybe there is some weird logic happening on the frontend when the user hits cancel? Since when the user inserts any text into the field it is fine, I'm not as worried about altering the logic there and just added this line to handle weird cases where writeupList is empty and doesn't match the length of files.

How Has This Been Tested?

Reproduced the steps before and after the fix, and saw that the failure no longer occurred.

@brianbolt
Copy link
Contributor

If you add a writeup to the first row would this fix still work?

Click View/Edit files
Upload a new file to the list
*Fill in the writeup to that row
The UI automatically adds another file chooser below the new file uploaded.
Click the "cancel" button on this new file chooser line
Click the "Upload" button

@hhan-schrodinger
Copy link
Contributor Author

@brianbolt - yep, tried it and it works!

Copy link
Contributor

@brianbolt brianbolt left a comment

Choose a reason for hiding this comment

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

Great. LGTM

@hhan-schrodinger hhan-schrodinger merged commit 4736d2a into release/2024.2.x Apr 9, 2024
3 checks passed
@bffrost bffrost deleted the ACAS-755 branch April 15, 2024 22:24
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.

2 participants