fix: display all uploaded S3 assets in the assets tab#4162
Open
yugalkaushik wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue:
Fixes #4085
This PR fixes an issue where some files stored in S3 for a user weren't showing up in their Assets tab, even though the total size calculation correctly increased.
In server/controllers/aws.controller.js, listObjectsInS3ForUser was fetching all objects from S3 but then filtering them to only include assets that could be mapped back to an active sketch project. If an asset wasn't referenced in a sketch (e.g. if it was uploaded but not yet used or if the sketch referencing it was deleted) it was hidden from the UI but still counted against the user's storage quota.
Before
Even though the image exists in S3, no image is being displayed in the Assets section. However, its size is still being counted toward the storage limit, as shown in the image.
Demo with fix:
preview-assetfix.mp4
Changes:
I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #123