Skip to content

Orphaned Assets Fix#4119

Merged
raclim merged 9 commits into
processing:developfrom
yugalkaushik:orphaned-assets
Jul 17, 2026
Merged

Orphaned Assets Fix#4119
raclim merged 9 commits into
processing:developfrom
yugalkaushik:orphaned-assets

Conversation

@yugalkaushik

@yugalkaushik yugalkaushik commented May 17, 2026

Copy link
Copy Markdown
Contributor

Issue:

Completes #4107

This change adds a pending-upload workflow for user assets so files are not permanently stored until a project is successfully saved. It also adds rollback for failed clones and a scheduled cleanup path for abandoned pending uploads. Uploaded assets now go to a pending S3 prefix first, are committed into the final user/project location on save, and are removed later if they stay pending too long. The cleanup threshold is 7 days.

Demo:

preview-orphanedassets.mp4

Changes:

  • Uploads are signed into pending/{userId}/... using the authenticated user id.
  • Project creation and project updates both commit any pending assets after a successful save.
  • Pending uploads are kept for 7 days before they become eligible for cleanup.
  • Abandoned uploads under pending/ are cleaned by an S3 lifecycle rule (prefix pending/, expire after 7 days).

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@khanniie

Copy link
Copy Markdown
Member

Hi Yugal! Thanks so much for the PR! Apologies for the delay, will take a look this upcoming week.

@khanniie
khanniie self-requested a review May 24, 2026 15:47
@yugalkaushik

Copy link
Copy Markdown
Contributor Author

@khanniie Reminder for review 👩🏼‍💻

@khanniie

khanniie commented Jun 2, 2026

Copy link
Copy Markdown
Member

actually if @raclim is back maybe she would be a better reviewer for this one? I don't have much context on the backend side of the editor to be honest

@yugalkaushik

Copy link
Copy Markdown
Contributor Author

@raclim Hi, I have updated the logic to use a better approach, please review the PR.

Comment thread client/modules/IDE/actions/project.js Outdated
Comment thread client/modules/IDE/actions/project.js Outdated
Comment thread server/controllers/project.controller.js
@skyash-dev

Copy link
Copy Markdown
Contributor

hi @yugalkaushik!
good work. left some comments.

i noticed two related issues:

  • deleting uploaded assets from an unsaved sketch only removes them client-side (deleteFile in client/modules/IDE/actions/files.js). the corresponding file in s3 remains under pending/, so deleting an asset should also remove the actual object from s3.
  • listObjectsInS3ForUser() in server/controllers/aws.controller.js only lists objects under ${userId}/. since pending uploads are stored under pending/${userId}/, they don't appear in the assets list (Incorrect Asset Size Limit Error #4085).

combining these two issues means there is currently no way for a user to delete uploaded assets from an unsaved sketch (both issues are still present in this release).

@yugalkaushik

Copy link
Copy Markdown
Contributor Author

@skyash-dev thank you for the review, I'll fix these in coming days.

@raclim raclim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for your work on this @yugalkaushik! Sorry that it took a while to review!

I think it looks okay to me so far so I'm going to merge this in, but definitely open to any further testing over the next few days before release next Tuesday!

@raclim
raclim merged commit e1ca052 into processing:develop Jul 17, 2026
2 checks passed
@raclim

raclim commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Wait sorry @yugalkaushik! Could you provide a screenshot or specify the configurations for the S3 lifecyle rule?

@yugalkaushik

Copy link
Copy Markdown
Contributor Author

Hi @raclim Here is the exact screenshots for the lifestyle rule.
image
image
image

@raclim

raclim commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Awesome! This is super helpful, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants