Has there been an update to the way JS handles redrawing the screen?

I just wanted to ask whether there has been some big update in the way javascript handles/redraws in the last couple of days? I haven’t checked my scripts for about 5-6 days and last I checked, everything was working fine. Haven’t touched anything in meantime. Now, all of my scripts technically work, but are corrupt in a particular way (which leads me to think that there has been something done on pavlovia/server side of things). Basically all my interactions, be it mouse clicks or typing are misbehaving. For example, opacity changes in objects due to mouse clicks do not show up unless I exit full screen or resize the browser window. The text input doesn’t erase the “?” in the textbox and has to be done by pressing backspace. Also, in another experiment I have counters hidden by occluders and now the counters show up on top, meaning I can see the numbers, but the occluders are as their background. All those things worked as intended just couple of days ago.

I had exactly those problems before (late October), until I realised that I had to do some particular settings in a certain way. For example, needed to set the opacity change with code, but in order to show the mouse click feedback for opacity change, had to make the size of the object to be set at every frame, which made the whole thing work. Until I did that, I was experiencing the same misbehaves that I just described above.

So, in a way, things have reverted to non-working order, but in the builder I have my workarounds set properly. This makes me feel like something has been changed on the pavlovia-end of things.

Sorry for the long and broad explanation.

Ivo Todorov

Hi @ivobivo, sorry to hear PsychoJS is giving you problems, could send me a link to one of your projects so I can look at the code? Here to help, thanks, s.

Thanks for quick reply @sotiri!

Here is a link to my mental rotation task script. It is in Italian (don’t have one in english yet) but spacebar and mouse clicks is all it takes to advance.

No problem @ivobivo, sorry not sure I get what the problem is, for me clicking on the spacebar once seems to be working like you describe? x

Yes, but mouse clicks on the figures don’t change opacity, as they used to do. Once you resize the browser, you see the squares with orange tint (meaning visual feedback of clicked squares). For next slide, same happens, one has to constantly resize the browser window to see the clicks. Used to have this error before and fixed it by changing the size parameter for each square (the invisible ones on top of the figures, the ones that change opacity) to update every frame. That did the trick then (even though it was not logical). However the error has returned but I haven’t changed anything. That is why I was asking if tehre was some update to the platform that was done in the last week.

Yes there have been changes but only minor. OK I see, the problem is with mouse clicks and opacity changes, could you please give me developer access to the repository so I can look at the code? Thanks for flagging, s.

@sotiri Of course. How do I do that?

OK great, thanks, this link should give you the details https://docs.gitlab.com/ee/user/project/members/index.html

done and done!

1 Like

I’m having similar issues since the recent update. On some random trials, my stimuli are not rendered correctly unless I exit the fullscreen. Task: https://run.pavlovia.org/hanzh/cued-color-singleton-task/html Question: New strange error: Display is different in fullscreen vs. no fullscreen

Hi @hanzh, alright, on it, thanks for flagging, x

1 Like

Hi @sotiri,

I created a minimal script with the code component that I am uploading here. Even though it runs fine locally on my computer, the version in pavlovia exhibits the same behavior as previously described. The square changes opacity when clicked, but need to exit full screen (resize the browser works as well) in order to redraw it correctly.
url: https://run.pavlovia.org/ivobivo/opacity-tast

opacity_test.psyexp (7.2 KB)

Thanks @ivobivo, that helps a lot, x

Hi @ivobivo, does the fork below work as intended? Thanks, x

1 Like

@sotiri, yup, it does. Perfect. What do I have to do to make my scripts work like that?

Hey @ivobivo, OK great, thanks for confirming. I have created a merge request for you to accept the relevant fix into your project. Please note that if you now edit the project in PsychoPy and export for Pavlovia, you would need to again tweak lines 5-11 in your main script to import from ‘custom-lib’. Soon enough a permanent fix should be in place and I will be making sure to follow up here to inform you. Please let me know if you come across any more issues, s.

1 Like

Thanks @sotiri, for the amazing support. Merged the project and everything works fine. However I have couple of other tasks that broke in the same way, so I’ll have to apply your tweak with lines 5-11to them as well. Will try it later on today or tomorrow. Thanks!

Sorry to bother again with the same issue @sotiri, but I have another script, basically identical though instructions are in swedish. I changed lines 5-11 in the .js file, but it is stuck on “initialising experiment” if I try to run it (uploading two screenshots, one with the change in code and one with the issues the console shows). It seems as it is not findings the custom libraries that fixed the previous script. Shouldn’t your fix basically work on any script that exhibits the problem? Especially since both scripts are identical in terms of code.

Hi @ivobivo, I think you’re right, can you double check the ‘custom-lib’ folder containing those scripts is in place? s.

Ah, didn’t realize you added a whole folder to the script. I’m an idiot! I will just move the folder to every script’s directory + change the 5-11 lines of code. Will get back to you if it doesn’t work. But it should. Thanks again!