Skip to content

[Draft] Orphaned Assets Fix#4107

Draft
raclim wants to merge 3 commits intodevelopfrom
orphaned-assets-draft-fix
Draft

[Draft] Orphaned Assets Fix#4107
raclim wants to merge 3 commits intodevelopfrom
orphaned-assets-draft-fix

Conversation

@raclim
Copy link
Copy Markdown
Collaborator

@raclim raclim commented May 5, 2026

Background

This PR addresses issues with orphaned assets accumulating in the AWS s3 Bucket. Currently, one confirmed cause can be reproduced by:

  1. Creating a New Project.
  2. Uploading an Asset.
  3. Closing the Project Window/Tab without Saving the Project.
  4. Comparing the listed assets within the database vs. the s3 bucket. The asset uploaded to the unsaved project will be visible in AWS, but the project will not exist in the database.

Another potential cause is when project cloning is disrupted, since it appears that assets are uploaded to s3 before the project is successfully cloned.

Changes:

This PR proposes creating a pending folder within the S3 bucket that will hold uploaded user assets until a user saves their project. On project save, the asset should be removed from the pending folder and be moved to the general bucket. This PR is incomplete, and currently conflicts with other scenarios, such as when a user uploads assets to a saved project.

This solution altogether is also just a suggestion, so I'm definitely open to other ideas on this as well!

  • aws.controller.js : Reference req.user.id instead of req.body.userId. Adds in the pending folder when a user uploads an asset.
  • server/utils/pendingAssets.js: Adds a util that handles committing any pending assets to the general bucket on project save, which should copy the asset and delete it from the pending folder.
  • server/controllers/project.controller.js: Adds the commitPendingAssets util to the project controller and removes the portion checking for stale files. I felt that this wasn't successfully capturing
  • client/modules/IDE/actions/project.js: When a user attempts to clone a project, it will now delete any added s3 files if the project cloning fails.

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

@release-com release-com Bot deployed to p5.js-web-editor: rachel-orphaned-assets-draft-fix (tedfc40) May 5, 2026 02:50 Active
@release-com
Copy link
Copy Markdown

release-com Bot commented May 5, 2026

Release Environments

This Environment is provided by Release, learn more!
To see the status of the Environment click on Environment Status below.

🔧Environment Status : https://app.release.com/public/Processing%20Foundation/env-58239eb320

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.

1 participant