Skip to content

Discussion: deleting an asset should remove it from projects #2979

Open
@lindapaiste

Description

@lindapaiste

Increasing Access

It is confusing for a sketch to contain an asset which no longer exists.

Feature enhancement details

Let's say that I create a sketch and upload an image to it. Then I go to the "My Assets" page and delete that file. What should happen to the sketch?

Screenshot 2024-01-30 10 05 07

Right now we do not modify the sketch at all when the asset is deleted. The image (image.svg) will still be listed in the files menu of the project. But the file itself no longer exists, and cannot be previewed or used in the project. Trying to load the image with the p5 loadImage() function it won't work, and the error messaging is very confusing because it references the actual URL of the asset ("https://assets.editor.p5js.org/6457f440a66277001a43e859/201273ad-0121-44e1-a5b4-585ea4d9fb8e.svg") rather than the local file path ("image.svg").

Screenshot 2024-01-30 10 28 56

It also causes a bug where the sketch containing the deleted file cannot be downloaded. I fixed that bug by ignoring the deleted file, but that feels like a bandaid solution. The root of the issue is more fundamental -- why do we have projects containing files which do not exist?

I'm open to discussion on how we should handle this situation. My opinion is that when someone deletes an asset we should remove it from from the files array of any projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: AWS S3Category for AWS configurationEnhancementImprovement to an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions