p5.js-web-editor
p5.js-web-editor copied to clipboard
Saving doesn't work properly
Nature of issue?
- Found a bug
Details about the bug:
- Web browser and version: Chrome version 84.0.4147.110
- Operating System: ChromeOs version 84.0.4147.110
- Steps to reproduce this bug: Open the web editor make a new project and save it then open a new tab and insert the URL for the project and add /index.html to the end now the new tab will show your project but only the version the project was when you saved it for the first time
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
@patfr Hi, I have just done the same on my browser but the save option is working fine for me
Thanks for reporting! I think this is a cacheing issue rather than a saving issue. The solution would be similar to how https://github.com/processing/p5.js-web-editor/issues/1234 was fixed—adding a header so that the endpoint doesn't get cached ever.
Hi, @catarak can I try to fix this issue! I am able to reproduce it, so can I try to fix it out?
@m-e-l-u-h-a-n yes! you can go ahead and work on this issue 😄
@catarak I followed the dev-setup installation from develop/developer_docs/installation.md but when I start the development server using npm start and open it in browser, it opens fine. But I am not able to login in to the dev server the page is stuck as it is and no logs/errors are there in the console. I have development setup on:
OS: Ubuntu 20.04
Mongo Db Atlas, and manual method(not github login) for login.
I has signed up using manual(email password) method, and can see the new user created in Mongo Db compass.
Can you please guide me over what could be the problem?
Sorry for reaching out from here as I could not find any community channel for the project. I found one slack channel link from Gsoc page but it allows login/signup only if one has @processing.org email address.
EDIT: Also tried the github login but it does not redirects to the Authorization Callback URL after authenticating.
If you look at the API request for login (like in the Network developer tools) when you submit your username/password, is there an error code or does it return a 200 code?
Yes it did return a response code of 200 but, it also returned me following TypeError in the console:

Upon looking at line 66 in actions.js as suggested by the error console, I saw that execution did reached the catch block, because error.response was tried to be accessed their. Is it some bug, or am I proceeding in some wrong direction?
Thanks for looking into this! I'm able to reproduce the same error. I believe it was introduced by #1707—will try to fix this now.
Okay, I was actually able to figure this out! Turns out it's not an issue with #1707, it's an issue with the npm library mongo-connect and mongodb+srv urls. I'm going to open a PR and fix this!
Thanks, @catarak for a really quick fix 😄 !
@catarak I have checked for this issue and was not able to reproduce it in development mode. Although I can still reproduce it in the editor.p5js.org website. A summary of what I tried out(In my development server):
- After login I created a sketch and saved it's version-1(initial save).
- Then in another tab I opened the sketch's url along with
/index.htmlappended to it. - And then I made changes to my sketch in previous tab, and saved next version of the sketch and in another(one more new) tab I repeated step 2 and changes were in sync with the latest version of the project.
- I tried saving many further versions and found that every time I repeated step-2 it was in sync with the latest version of the sketch. I also did same with different windows of my browsers, and the results were same. If I am following the pathway described in the issue to reproduce it, I think this issue is probably resolved in development mode.
This must have something to do with caching via Cloudflare 😕
I don't know if this helps, perhaps part of it anyway, but I came into a problem today where the cache seemed to be confused about what version to display. I thought I'd lost a couple hours of work on a sketch, but My Sketches link to the sketch showed the correct time of my last save.
I was able to recover that version of the sketch by wiping my browser cache back past the date, in this case, when I created the sketch ( as it was only a day old ) - which generally also made me have to log in again.
Using Brave browser ( chromium based ).
I hate to suggest it, but cache busting with timestamps actually works the way one would expect. :-(
...had lots of finnicky issues with chromium cache in the past.