Closed Jeffotter closed 1 year ago
Thank you, @Jeffotter. I can't seem to access your repo. Would you mind adding me as a contributor with Read permission? Thanks!
@npaton done! Sorry about that
It is happening because assignPlayer
is called without await
. To fix it, you need to add an async
around that callback and add await
on the assignPlayer
line.
It took me a while to find the issue, it did not jump at me, and this is likely to cause problems for others. We'll make sure to have a warning about it in the docs when they are done. I've also created a fix for this, so that we commit all the changes even if await was not used: https://github.com/empiricaly/empirica/pull/410. But I am currently unsure about the consequences of changing this behavior, so I haven't merged it yet. TBD
Is there an existing issue for this?
What happened?
When I begin a default app and attempt to make a game with a custom assignment. I created four games,
Input their ID -- no issues. Begin intro steps -- (players currently guessing jellybeans freeze to a loading screen)
When I refresh the two original players, they can now see the avatar of the new player while the new player is still in the intro steps.
Game resumes
Steps To Reproduce
Create a default game
Make a treatment
Modify App.jsx , Stage.jsx, Callbacks.jsx, server/index.js (code locations attached below, error was occurring before stage modification ) Custom assignment copied from here (https://github.com/JamesPHoughton/external-grouping)
Start the game and create 3 Players
Run 2 players through the intro steps and the game will begin
While the game is running, start the third player
After the 3rd player submits his ID the other two players will be frozen.
Refresh on the two original players and see the third player who should still be in the intro steps
Empirica Version
What OS are you seeing the problem on?
macOS
What browser are you seeing the problem on?
Chrome
Relevant log output
Anything else?
https://github.com/Jeffotter/demo_unmanagedGame/blob/main/server/src/callbacks.js https://github.com/Jeffotter/demo_unmanagedGame/blob/main/server/src/index.js
https://github.com/Jeffotter/demo_unmanagedGame/blob/main/client/src/Stage.jsx https://github.com/Jeffotter/demo_unmanagedGame/blob/main/client/src/App.jsx
Code of Conduct