Altinn / Altinn/app-frontend-react
File upload of many files at once sometimes fails strangely
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description of the bug
File upload of many large files sometimes fails. See steps to reproduce and additional information.
### Steps To Reproduce
1. Go to https://oed.apps.tt02.altinn.no/oed/havvind-utsira-nord
2. Go to the page: "Opplasting"
3. Upload 10-15 large files at the same time in any of the file uploads (we've used files of 338MB)
4. See that the files have started their upload
5. See that the files suddenly disappear
6. Try uploading some files again in the same upload where the files disappeared
7. See that you get a similar error message
### Additional Information
The current hypothesis is that the frontend state is reset somehow to not having any files, but they have been uploaded to the backend. The frontend and backend are therefore not in sync, and when trying to upload new files, there is a mismatch which causes the frontend to fail. Not sure exactly where and when it happens, but looking at the current solution we should investigate the possibility to also refactor it. An alternative could be simpler solution leveraging the power of React Query mutations and mutation state instead of complex Zustand stores and React Contexts.
Contributor guide
Research direction
No file or test is named. Start with the Opplasting file-upload flow and trace how Zustand stores, React Contexts, and React Query mutation state represent concurrent uploads; reproduce with 10–15 large files and verify that the frontend and backend remain synchronized without the files disappearing or subsequent uploads failing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100