Description
p5.js version
No response
What is your operating system?
None
Web browser and version
No response
Actual Behavior
Expected Behavior
I should be able to download p5's sketch without any error.
The sketch actually does export successfully, using the saved version of the project.
We are getting this message because we make a PUT request to the API before exporting a sketch. That API request will fail if the user is not the owner of the sketch. The easiest solution would be to only make that API call if there is a logged in user and that user is the owner of the sketch.
The relevant code is here:
p5.js-web-editor/client/modules/IDE/hooks/useSketchActions.js
Lines 42 to 45 in 64c36ca
There is some nuance here with regards to how we would handle local/unsaved changes. Right now those changes would not be applied if it is not your sketch. This is part of a larger discussion happening in #2904.
Steps to reproduce
Steps:
- Make sure that you are logged out
- Go to a sketch which is not your own, such as https://editor.p5js.org/p5/sketches/Data:_True_and_False
- Click the "File" menu
- Click "Download"