Hello there! I'm using @delucis' bgio-effects and I'm trying to access it inside a phase's onEnd hook but it comes out as undefined while ctx.random is there alongside the other default plugins.
@delucis created a reproduction after a short chat.
I did a bit more digging writing some failing tests and discovered that there seems to be link with the flush of the plugins. Plugins without flush are available and if a plugin has a flush it's not. I'm not too familiar with the structure of boardgame.io so I mostly dug around with some console logs to track it down.
When this part of the code executes, pluginState contains all the right things, but only the data gets written which removes the API that the plugin provides and thereafter the relevant plugin in state.plugins is just an empty data object.
I'm happy to provide a PR/fix but I'm not too sure what is supposed to happen. Would adding back the rest of the state like here be a simple fix that doesn't disturb anything else?
Hello there! I'm using @delucis' bgio-effects and I'm trying to access it inside a phase's
onEndhook but it comes out asundefinedwhilectx.randomis there alongside the other default plugins.@delucis created a reproduction after a short chat.
I did a bit more digging writing some failing tests and discovered that there seems to be link with the
flushof the plugins. Plugins without flush are available and if a plugin has aflushit's not. I'm not too familiar with the structure of boardgame.io so I mostly dug around with some console logs to track it down.When this part of the code executes,
pluginStatecontains all the right things, but only the data gets written which removes the API that the plugin provides and thereafter the relevant plugin instate.pluginsis just an emptydataobject.I'm happy to provide a PR/fix but I'm not too sure what is supposed to happen. Would adding back the rest of the state like here be a simple fix that doesn't disturb anything else?