willowtreeapps / wombats-api

Wombats API
https://github.com/willowtreeapps/wombats-documentation
MIT License
10 stars 4 forks source link

[BUG] Last game displays before updating to current game (~1 sec) #241

Closed morganduverney closed 7 years ago

morganduverney commented 7 years ago

On either Chrome or Safari, navigate to the Games - Joined screen Choose a game ("Game 1") and view the game end state Navigate back to Games - Joined screen Choose a different game ("Game 2") to view the game end state

Expected Results: Game 2 details are displayed (name, number of players)

Actual Results: Game 1 name and number of players are displayed briefly (~1 sec) before updating to Game 2 details

dehli commented 7 years ago

To fix this we can clear the store in the unmount callback for game-play so that it's reset when you go to another game.

oconn commented 7 years ago

This looks like it's working as intended and may have been addressed after the creation of this ticket. The follow is the code that supports clearing the arena.

(defn clear-game-state []
  (re-frame/dispatch [:game/update-frame nil]) ;; Clears arena state on unmount
  (re-frame/dispatch [:game/clear-chat-messages])
  (re-frame/dispatch [:game/stats-update {}])
  (ws/send-message :leave-game {:game-id @game-id})
  (reset! game-id nil))

Moving back to QA for verification

morganduverney commented 7 years ago

@oconn I'm still seeing this issue, exactly as written in the repro steps. Moving back to ready.

morganduverney commented 7 years ago

I'm no longer seeing this issue, but instead I'm seeing a ~1 sec delay in loading the arena, status bar and game details. I'll assume that's ok for now, moving this bug to closed.

oconn commented 7 years ago

@morganedmonds Yeah good for now, we need to create a ticket for jesse to create loading indicators.