Strange psychoJS.downloadResources error

Hi,

I am downloading some resources at the start of the experiment (in psychoJS.start) and then other resources during the experiment using psychoJS.downloadResources. I have found that when I call downloadResources, all the resources first downloaded using psychoJS.start (confirmed with the JS console) are being downloaded again! Does anyone have any clue?

Thank you,

Laurent

Hey!

I took a look in an experiment of mine that also downloads some resources at the start and some others via downloadResources, but the resources at start only get downloaded once. Shall I share my experiment so you can compare?

Best, Thomas

Ok that’s strange! Yes if you don’t mind sharing, that might be helpful, thank you!

Done! It’s called int_gonogo2. Still an early prototype btw

Thank you! However when I get to your gitlab page, I cannot see the code, I just see the home page with the mention “This project does not have a wiki homepage yet”.

Sorry, gave you the wrong role. Now it should work.

Thank you! I still don’t understand why it does this in my experiment though… Maybe it’s the older version of PsychoPy that I use? The other difference is I don’t create a full routine with a “One moment…” screen, I just add a function (and add it in the scheduler) to download what I need and so it’s downloading while my experiment is occurring… I checked my previous experiments and the same thing was happening (although I wasn’t noticing because there were less files). It’s as if it can’t help but download all the resources that are “registered”… I might just use a workaround…

You’re programming your experiment directly in PsychoJS instead of via builder?

Yes. There might be an error somewhere that I can’t see… Anyway it’s ok, I don’t have too many files, I decided to download everything at the start, it takes 2-3 minutes. I wanted to see if this was a bug that other people got… Thank you for your help again!

1 Like

Ok I have no idea why… sometimes it downloads everything twice and sometimes not… And I’m always in private browsing… It’s a problem because when it downloads twice, it’s like the files were not downloaded at first and so there can be a bug because of a missing file…

I wonder if this is what was happening to me. I set up a background download of nearly 500 image files and for some reason the person I was writing the experiment for got an error which suggested that one of the files wasn’t available. When I tested it, I didn’t get an error on that file (I’d removed randomisation to test). I ended up reducing the file size (which didn’t help) and then dumping my background loading code in favour of downloading everything at the start (which did).

1 Like

Some weird differences in how our scripts behave! I’ve got some good news though: we’re working on an improved method for downloading resources on the fly, so then next version of PsychoJS should have this all work a bit smoother.

2 Likes