Closed ppyyrryy closed 4 years ago
Hey, Would you mind explaining a bit further what you mean by queuing and in which context you see the issue (Module, Executable, what file, etc.)?
One of my Executables sets a value for a Handler that I need in another Executable later inside a Procedure. However, if the browser loads and runs the latter Executable before the former one that sets the value, the latter Executable misses information it needs.
It seems that different browsers handle large amounts of simultaneous requests differently, and some queue them in wrong order in this case.
I hope this clarifies something. It seems tricky to me as I see it quite purely browser-related and have no idea how to control queuing - Tatool seems to send requests in the correct order, that in which the Executables are introduced in the Procedure.
I assume you're talking about the initialization of Executables at session start as the actual execution of the Executables should always be in the order defined in your Module. The order of initialization of Executables is indeed not guaranteed.
In case you are setting a property to a handler in the init() method of an Executable, I wonder what value that could be which is not static and therefore couldn't be set in the Handler directly? Maybe if you can give me a concrete example of what is happening where I can come up with an idea on how to implement it.
Yes, that is the problem.
I need a same randomized order of stimuli in two consequent tasks. I'm doing it while initializing the executable of the first task by shuffling numbers in an array and passing the sequence of numbers to the handler as one integer that I then read in the executable of the other task. There must be some better way to do this but I'm not finding it right now...
I think a possible improvement for the future would be if we introduced an init method for handlers, which would run before the Executable init methods. As handlers are meant to provide functionality spanning multiple Executables, it makes sense that this "random sequence" can be set in the handler and then be accessed from the Executables. I will definitely look into that.
As for now I think the following might work for you:
Let me know if you need more detail or if I missed something.
Thank you for your help!
I need to do it only once, so I decided to go by your last point, which adds some duplicate code but does work.
However, Chromium currently completely fails to load some files of the experiment, at least over slow connections (maybe timeout). Firefox and Chrome work now.
I've got to say I've never actually tried Chromium. Is it reporting a timeout for specific resources? Is it random?
Currently my Chromium, Chrome, and Opera work, but Firefox does not. For some reason it does not go to downloading the files of the experiment at all after beginning to load the module. This seems to be the same behavior that I have seen from other browser before. What I see in Firefox console is:
Running module (public): 64956a3b-20aa-4394-8403-073edfd2d277 vendor.min.js:52:73402
uncaught exception: [object Event] (unknown)
InvalidStateError vendor.min.js:73:1315
This is what I see in the Firefox debugger:
Bump, this remains on Firefox. Another screenshot below from the debugger states that there would be a SyntaxError. How could that be fixed?
Can you give me a few more pointers. Are you running this experiment locally? Did you get the latest version of tatool-web from github? Can you show me the error message in the console? What version of firefox are you experiencing the issue with?
The same behaviour has occurred both locally and online. I have the latest version of tatool-web and the same goes.
The call stack is in the above screenshot. The error message of the console:
Paused on exception SyntaxError: '*,:x' is not a valid selector
This has occurred throughout the Firefox ESR version I have been using, currently 60.3.0esr (64-bit).
Despite all this, weirdly, today I only seem to get this when I have Firefox Developer Tools opened. Very confusing.
More weirdness. Firefox private browsing seems to trigger this, too.
Unfortunately the errors are not really telling me where it's failing as the code is minified and won't make sense. I did download the latest Firefox ESR and ran a module locally without any issues so my guess would be that it must be specific to your module, unless you're saying it happens with any module available on Tatool Web? I had no luck finding the moduleId you mentioned above, can you point me into the direction of the module you're running?
This error continues with Firefox ESR in my updated instances of Tatool Web, with all of my own modules and a downloaded Flanker test module, too. With the webpack I was able to find the error output as in the following picture. Also strange is that Firefox developer tools break the running of my local instance somehow, so that the user interface does not come in view at all. Could you track something based on these findings?
The error above unfortunately doesn't help as it doesn't seem to be tatool specific. I've downloaded Firefox ESR (68.0esr (64-bit)) and ran an example module (https://raw.githubusercontent.com/tatool/tatool-web/master/app/projects/public/tatool/modules/demoFlanker.json) without having any issues.
Maybe it's worth cleaning out your install to make sure it's not an environment issue (corrupt dependencies etc.). Start by deleting your node_modules folder and then run "npm run setup" again to download all dependencies and rebuild tatool.
Closing due to inactivity.
Hi all,
Has anybody had problems with browsers queuing files of an experiment in wrong order, resulting in missing objects? I'm currently seeing this for my experiment with Chromium but not with Firefox - a handler remains unset at the time when an executable would need it set.
Any ideas how to control queuing from code or to fix this otherwise?