Description
openedon Oct 24, 2024
Describe the bug
During the birth registration process (tested in OpenCRVS-Madagascar), files are compressed before being uploaded. However, the system calculates the total upload size based on the original, uncompressed file sizes, which results in an incorrect size calculation for enforcing the 20MB limit.
I should be able to upload multiple compressed files as long as their total size remains under the 20MB limit. However, the system currently restricts me to only three files because it incorrectly calculates the total size based on the original file sizes rather than the compressed sizes.
Which feature of OpenCRVS your bug concerns?
This bug concerns the File Upload feature during birth registration. Specifically, it involves the compression process and the enforcement of the 20MB file size limit.
To Reproduce
Steps to reproduce the behavior:
- Log in as a system admin or registrar.
- Go to the birth registration form where files can be uploaded.
- Upload multiple files.
- Compression will occur during the upload process.
- The total file size is calculated based on the original files instead of the compressed versions.
- See error where the upload may be allowed or rejected inaccurately due to the wrong size calculation.
Expected behavior
The total size of the uploaded files should be calculated based on the compressed versions of the files. The system should ensure that the total size of the compressed files does not exceed the 20MB limit, preventing any inaccurate size limit enforcement.
Actual behavior
Currently, the system calculates the total size based on the original file sizes before compression. This causes the size limit enforcement to be incorrect, potentially blocking uploads even when the compressed total is below 20MB.
OpenCRVS Core Version:
v1.6.0 (Git branch: master / release-v1.6.0)
Country Configuration Version:
v1.6.0 (Git branch: master / release-v1.6.0)
Desktop (please complete the following information):
OS: Ubuntu 24
Browser: Chrome
Version: recent version 130.0.6723.58
Possible fixes
Modify the file size calculation logic to only include the sizes of the compressed files instead of the original file sizes.
This can be done post-compression during the upload process.
Reproducible demo
N/A (If available, provide a demo link or project for reproduction.)
Metadata
Assignees
Type
Projects
Status
Completed