Skip to content

refactor/fix(website): Block submissions proceeding while files are still uploading - #7050

Open
tombch wants to merge 4 commits into
bulk-file-submissionsfrom
upload-state-refactor
Open

refactor/fix(website): Block submissions proceeding while files are still uploading#7050
tombch wants to merge 4 commits into
bulk-file-submissionsfrom
upload-state-refactor

Conversation

@tombch

@tombch tombch commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

resolves #6766, replaces #6855

Summary

  • Lifts FileUploadState out of each FolderUploadComponent and into a single state of Map<FileCategoryName, FileUploadState> for the submission/revision/edit components.
  • From here, adds validation for all file categories to be in state uploadCompleted before proceeding with submission.

Screenshot

Attempting (multiple times) to submit while a file is still uploading:

image

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by appropriate, automated tests.
  • Any manual testing that has been done is documented (i.e. what exactly was tested?)

🚀 Preview: Add preview label to enable

…sion proceeding while files are still uploading
@claude claude Bot added the website Tasks related to the web application label Aug 10, 2026
@tombch
tombch marked this pull request as ready for review August 11, 2026 10:21
@claude

claude Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Claude finished @tombch's task in 3m 20s —— View job


Claude finished reviewing this PR

  • Gather context (diff, changed files)
  • Understand the request (comprehensive code review)
  • Review code quality
  • Review security
  • Review performance
  • Review testing
  • Review documentation
  • Post inline comments for actionable issues
  • Post final summary

Summary

The refactor cleanly lifts FileUploadState (and the previously-inlined types) out of FolderUploadComponent into a shared fileUpload.ts module, and threads a Map<category, FileUploadState> down from DataUploadForm/EditPage. The new validateFileUploadStates check is wired in before both the submit and edit flows, which correctly resolves the underlying issue of allowing submission while uploads are still pending. The test suite was updated well to reflect the new state-lifting approach (using a wrapper component to hold state rather than mocking setters), and still covers the same behaviors as before.

Left two inline comments, both minor:

  1. EditPage.tsx — the new fileUploadStates initial state isn't using the lazy useState(() => ...) form the old code used, so it's recomputed every render.
  2. fileUpload.tsUploadStatus includes 'awaiting', which is unreachable given how it's actually used in getStatusIcon.

Notes

  • No dedicated unit tests were added for the new fileUpload.ts module (getInitialFileUploadStates, validateFileUploadStates), though the behavior is exercised indirectly via FolderUploadComponent.spec.tsx. Given these functions now carry the core "block submission" logic, direct unit tests would help pin down edge cases (e.g. empty categories, mixed states) explicitly.
  • I could not run npm run test / npm run check-types in this environment (no network access to install dependencies), so I wasn't able to verify the build/test suite passes — the sandbox blocked npm install/git fetch over the network. Please confirm CI is green.

Comment thread website/src/components/Edit/EditPage.tsx Outdated
Comment thread website/src/components/Submission/FileUpload/fileUpload.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant