Closed
Description
Nature of issue?
- Found a bugExisting feature enhancementNew feature request
Details about the bug:
- Web browser and version: Firefox Version 64.0 (and the lastest version of Chrome)
- Operating System: MacOs Sierra Version 10.12.6
- Steps to reproduce this: don't save/refresh code's modifications when I try to run the program.
Activity
catarak commentedon Dec 17, 2018
thanks for reporting @nanaosakisan! can you be more specific about how to reproduce this bug? for example, by listing out a few steps? i don't understand what the bug is.
nanaosakisan commentedon Dec 18, 2018
shiffman commentedon Dec 18, 2018
I have noticed some odd behavior like this after the fix for #675 was published. I think this may be related? I meant to file this a few days ago, but I forgot. You can see the trouble I was having here:
https://youtu.be/pKyU92cza0Y?t=1978
I will investigate a bit more!
shiffman commentedon Dec 21, 2018
I encountered this bug again this morning. I still cannot determine what exactly is causing it and I don't see anything in the console output. But in case this is helpful, here is the sketch:
https://editor.p5js.org/codingtrain/sketches/SJMl3u5xN
This is what I am doing:
add()
topush()
.Uncaught TypeError: next.add is not a function
add()
.shiffman commentedon Dec 21, 2018
(Update I restarted browser and was able to save the change)
catarak commentedon Dec 21, 2018
thanks for the updates! i'm going to dig into this.
catarak commentedon Dec 21, 2018
i think what's happening here is inconsistency between what's in the editor, what's in the redux store, and what's on the server. when a sketch is saving, and then a user changes the editor, i think it's not getting into sync properly, and maybe the change i made is just exposing this.
update: i'm having a hard time consistently being able to reproduce this. i'll keep looking at this and hopefully figure it out soon 😕
shiffman commentedon Jan 13, 2019
I taught a workshop and ran into this issue a few times with attendees. I unfortunately noticed that from time to time it also does not render the code in the editor but from the last save (I think). Very mysterious! I am able to reproduce it more consistently with auto-save on, I recorded a screen capture here:
https://youtu.be/rhtIYnHICCs
Note at 46 seconds it renders
background(100)
while the code itself hasbackground(220)
.The video starts with autosave off and it's interesting to note that when I refresh the page you'll see the old code for a brief moment before the newly saved code replaces it.
Hope this is a bit helpful! I am happy to look into this more if anyone has suggestions for tests I can run!
catarak commentedon Jan 15, 2019
thanks @shiffman—hopefully i'll figure out how to reproduce this!
L05 commentedon Feb 5, 2019
I'm helping @REAS teach a class right now and we've had multiple students also encountering this issue (8+ within the past hour). They've reported saving (sometimes multiple times) over a duration only to have the code revert to an earlier version. This has happened to me as well; I'm having a hard time reproducing it consistently, but the behavior is very similar to what @shiffman has experienced in his screen captures. I'll update if I can find a reliable test case.
bengrosser commentedon Feb 5, 2019
I am seeing a version of this a lot over the last several days.
The symptom for me is that in the middle of writing code (or possibly also when running code), the source code in my editor pane instantly reverts to an older version, wiping out whatever changes I made in the last X minutes.
If I had that latest code running in the preview pane when this happens—and I didn't have auto-refresh turned on—then I am able to inspect the canvas (using browser dev tools) and find the most recent version of the script there so I can copy and paste it back into the editor pane. But if I had auto-refresh on, this swapping out of new code for old also changes what's in the DOM so my inspect trick doesn't work.
My suspicion is that when this code reversion happens, it is triggered when an auto-save happens, so I've turned off auto-save for the moment to see if I'm right. Will report back if I learn more. Happy to try and help further if I can—this is starting to feel regular to me (I've had it happen maybe 8 times in the last 3 or 4 days).
update--> Unfortunately, turning off auto-save isn't a useful workaround. I've had it off for the last hour and just had my code reverted.
anuraghazra commentedon Feb 6, 2019
@shiffman @catarak I think I figured out how to recreate the bug consistently here are the steps (maybe won't work on your pc) - Auto-refresh is off
NOTE : i suspect that timing is really important in here, and i think this bug is causing differently on different Internet Speeds and throttles
Project Saved
andAutosave enabled
message then -background(0)
value and Savebackground(100)
value hit Save and then reload (ctrl+r) while theProject Saved
alert is visible on screen.jaytay579 commentedon Feb 11, 2019
A bump on this issue and a related question. I now have my students back working locally in Brackets instead of using editor.p5js.org until we have a reliable workaround for the issue discussed in this thread, but not being able to use the online editor for in-class experimentation really slows down the pacing of an already packed-to-the-gills course!
Which brings me to my related question: Does anyone know of another online editor that we could use with P5.js in the meantime? I tried to set up a project in JSFiddle, but the way that it sandboxes code appears to be incompatible with P5's "magic functions" (that's what I call setup(), draw(), etc. with my students).
L05 commentedon Feb 12, 2019
As a small follow up, I've found that disabling Autosave does not resolve this issue.
@jaytay579 I haven't tested it in a class setting, but it may be worth trying Codepen. Here's a template:
https://codepen.io/L05/pen/KJREpO?editors=0010#0
27 remaining items