feat(s3): stream s3 content over a zip file #822
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces several enhancements and fixes across the backend and frontend of the project. The most significant changes include implementing ZIP file generation for S3 storage, adding a custom exception filter for streaming responses, updating the frontend to display file count and size information, and improving code formatting with Prettier configuration.
Screenshot
Video
pr-stream-zip.mp4
Below is a categorized summary of the key changes:
Backend Enhancements
getZip
method inS3FileService
to generate ZIP files for files stored in S3. This method streams files from S3, compresses them using thearchiver
library, and handles errors gracefully.StreamResponseFilter
to handle exceptions during streaming. If headers are already sent, the filter logs the error and terminates the stream; otherwise, it sends a JSON error response.StreamResponseFilter
to thegetZip
endpoint inFileController
and updated the method to handle asynchronous ZIP file generation.Frontend Updates
share.fileCount
) and thebyteToHumanSizeString
utility.