Page 1 of 2
[SOLVED] Erratic behaviour of the "Rematch" button
Posted: 10 June 2021, 13:11
by junibegood
I got a strange bug report about Canosa, here :
https://boardgamearena.com/bug?id=42234
Basically, the "Rematch" button does not always appear at the end of the game, sometimes it needs a page refresh. I wasn't able to reproduce that behaviour.
The players who submitted it seem certain that this is specific to Canosa and does not happen with other games. Both these players have thousands of games played on BGA, so I'd rather trust them about this. And besides, I didn't find any similar bug report about other games or BGA in general.
So my question is : as game developpers, what kind of control do we have over that button ? I did some research in the studio docs and found nothing. The only information somewhat related to the rematch feature is the color rotation setting in "gameinfos.inc.php". I can't see how this could have anything to do with the button appearing or not.

Re: Erratic behaviour of the "Rematch" button
Posted: 10 June 2021, 13:35
by robinzig
Sounds strange - the only thing I can think of is perhaps in rare circumstances you have some other element in your interface which covers the button?
But hard to test that without being able to reproduce the situation. Bug reports that you cannot reproduce are the worst (I've yet to complete my first game for BGA so aren't at that stage yet, but know the problem well from my day job

)
Re: Erratic behaviour of the "Rematch" button
Posted: 11 June 2021, 22:42
by junibegood
Thanks for your feedback.
I don't display anything on the end game page. I don't believe that's even possible, except for the content of the statistics table. I don't think I'll be able to fix this bug, unfortunately. I agree with you, bugs you can't reproduce are terrible.

Re: Erratic behaviour of the "Rematch" button
Posted: 13 June 2021, 15:55
by jmcl99
I believe that at least some of the end game stuff is in (the framework generated part of) the HTML whilst playing the game, albeit inhibited and so I suppose it could be affected by any css applied to the page.
I think you may have to ask the reporting user to wait for it to happen again, and then to use the browser developer tools (maybe with fairly detailed instructions) to display (and dump) the HTML at that point.
Re: Erratic behaviour of the "Rematch" button
Posted: 13 June 2021, 22:36
by junibegood
That's an interesting lead to follow, thanks.
I think that's unlikely though, because I was careful to prefix all IDs and classes with the game name, there is very little chance of overlapping.
Re: Erratic behaviour of the "Rematch" button
Posted: 21 June 2021, 11:04
by junibegood
I was able to reproduce it. Here is what I discovered :
- This is not specific to Chrome, I had the bug on Firefox
- The buttons were visible at first. Then the "Rate this BGA adaptation" popup appeared, the buttons disappeared only when I clicked "Cancel" in that popup
- After a page refresh, the buttons reappeared
- I compared the HTML before and after, and the buttons were not hidden by something else, they were completely removed. The whole div #generalActions, which contains the three buttons "Leave", "Replay" and "Rematch" was not in the DOM when the buttons were invisible
Unfortunately, instead of taking screenshots when the buttons were invisible, I saved the HTML. This was a poor idea, because the saved HTML is completely different from the actual page and demonstrates nothing...
I'll try to take screenshots next time. But the questions remains : do you guys think there is at least a chance that this behaviour is really specific to Canosa and not a general BGA bug ?
Re: Erratic behaviour of the "Rematch" button
Posted: 21 June 2021, 18:43
by Een
I just tested using the "Skip" button on the rating popup for an alpha game, and buttons were stable.
I tried with Canosa, and the buttons disappeared exactly as you described. So it really seems specific to Canosa. I'm not sure what can cause that though, first time I see this.
Re: Erratic behaviour of the "Rematch" button
Posted: 21 June 2021, 18:59
by Een
Ok, I think I found it. You are using an empty string for the element id when using this.addActionButton('', cancelMessage, 'resetTurn');
This should be a unique identifier; with an empty string probably the event is associated to a node that gets triggered when there is a click on the rating popup button, and it triggers your "resetTurn" that sets a client state on the final "gameEnd" state, which must wreak havoc.
Very likely if you use a unique string for the button id, this issue will be resolved.
Re: Erratic behaviour of the "Rematch" button
Posted: 22 June 2021, 08:45
by junibegood
Wow, I would never have found that out by myself, thanks !
I'll try that tonight and let you know.
Re: [SOLVED] Erratic behaviour of the "Rematch" button
Posted: 22 June 2021, 19:07
by junibegood
You were right, that fixed it !
Thanks again.
