syd711 / vpin-studio

Competition, table, and player management for VPins.
MIT License
32 stars 2 forks source link

[Bug] 3.4.1: double display of high score scan notification, pauses game while second card is up #436

Closed gorgatron1 closed 2 months ago

gorgatron1 commented 2 months ago

Describe the bug

I noticed that the high score scan card shows twice -- the first time it shows with a score (if I got a new high score), then many seconds later it shows again. The second time it shows, if I am in the middle of playing a game, it pauses the game while it is up.

I presume the first (expected showing) doesn't pause the game, but I am not sure since it happens pretty quickly after leaving the game.

Picture, video, logs attached.

To Reproduce

  1. play a game, get a high score
  2. quit the game
  3. see the high score card show up (but maybe don't wait for it if you want to see step 5)
  4. (optional) go to the next game via popper and start playing
  5. observe that the second high score card showing up and pausing the game

Expected behavior

Expected: it would only show the high score scan once AND the card showing would not pause the game -- just be an overlay.

The pausing might be ok if it didn't show the second time (since the first card showing is pretty quick after exit).

Screenshots

A picture of my table -- notice the ball in the upper right and the card in the upper left. The ball isn't moving and the table is unresponsive while the card is up. I had enough time to grab my phone and take the picture.

IMG_0047

A video (at double speed to get the file size down) showing:

  1. exit tale -> popper
  2. wait ...
  3. high score card shows -- I got a new high score
  4. wait ...
  5. high score card shows again (this is the one I don't expect and is causing trouble)

https://github.com/user-attachments/assets/8259c40a-5299-4d23-bb8d-5e5ba580e033

Event log:

Sep 2, 2024, 4:16:15 PM [INFO] ******** Event Log Start **********
Sep 2, 2024, 4:16:15 PM [INFO] Resetted active game status
Sep 2, 2024, 4:16:15 PM [INFO] Executing table exit commands for 'Meteor (Stern 1979) Bord 1.0.0a'
Sep 2, 2024, 4:16:15 PM [INFO] Starting 6000ms update delay before updating highscores.
Sep 2, 2024, 4:16:21 PM [INFO] Finished 6000ms update delay, updating highscores.
Sep 2, 2024, 4:16:21 PM [INFO] Calculated changed positions for 'meteorb': 1
Sep 2, 2024, 4:16:21 PM [INFO] Created highscore version for Meteor (Stern 1979) Bord 1.0.0a, changed position 1
Sep 2, 2024, 4:16:21 PM [INFO] Sending discord default notification for: Meteor (Stern 1979) Bord 1.0.0a
Sep 2, 2024, 4:16:21 PM [INFO] Showing Notification "Meteor (Stern 1979) Bord 1.0.0a" (A new highscore has been created!)
Sep 2, 2024, 4:16:39 PM [INFO] Saved updated highscore for Meteor (Stern 1979) Bord 1.0.0a to Studio database.
Sep 2, 2024, 4:16:39 PM [INFO] Skipped card generation, no target screen set.

and logs (up to right after the video was shot):

vpin-studio-logs.zip

Desktop (please complete the following information):

syd711 commented 2 months ago

Disable this notification: image

There should be a check that notifications are not shown when VPX is running. I'll take a look.

davidkoski commented 2 months ago

The video shows double notifications showing up on top of Pinup Popper (though the report is about VPX).

syd711 commented 2 months ago

The first notification is about an actual new highscore. The second notification shows that the highscore processing is finished. That one is always shown so that the users knows that they can power down the cabinet without loosing the highscore updates.

The error is that none of them should appear when VPX is running.

gorgatron1 commented 2 months ago

Ah, I see. So perhaps the issue is that it takes a very long time to process the scores -- the first notification shows when I am still in popper and once it starts perhaps it has to finish. The "second" notification occurs ~10 seconds after the first, though I have seen longer sometimes.

I think it used to do all of this very quickly once the score scan started.

syd711 commented 2 months ago

This maybe because the VPin Mania score submission works synchronously now. We use a "database" that only allows 1x connection, so any parallel processes can lead to fatal errors. But the notifications are meant to be queued, so that they are shown on VPX exit. I need to revisit this check.

syd711 commented 2 months ago

Fixed with 3.5.0