-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
From a React app, I make a call to the Reboot backend, which I expect to update some data elsewhere in the React app, but it does not get updated.
From the web inspector, it looks like the protobuf with the new data is getting sent.
To Reproduce / Expected behavior
Steps to reproduce the behavior:
Visually:
- clone https://github.com/katfang/reboot-testbed/tree/main/cancel-pending
2. more info in the README there npm installnpx rbt dev runandnpm run devin two different terminals- Open localhost:3000
- click on a pawn, click another square to move the pawn
7. see green squares highlighting the move
8. see on the right side, move shows up with "Cancel link" - click cancel link.
- Expectation 1. The green squares go away.
2. In the console, see that "outstanding moves" updates with a "status: 5" instead of "status: 1" (1 corresponds with pending, 5 corresponds with canceled) - What actually happens: green squares stay, and "outstanding moves" logs with "status: 1"
However
- the backend logs that it sees status: 5
- If you check the web inspector's network for GetOutstandingMoves websocket's, it seems to get the data that "status: 5"
Other oddities:
- On my computer, increasing the number of pawns (in backend/src/game_servicer.ts -- PIECES_PER_TEAM) seems to increase how reliably you get this problem.
- Simplifying the code (some combination of reducing the Game object size, removing RPC methods on the BE, removing calls from the FE) often made the problem rarer. (e.g. commit 9533f5)
3. In the most clear cut instance, removing a call to Reboot from the React app (and a React component) seemed to make the problem rarer. (commit 33b280) - NOT all data is stale. Under "Pending Moves" the move is removed immediately, which implies some parts are receiving the right updates initiated by the cancel. The data for "Pending Moves" vs what backs making the green squares disappear is different:
5. "Pending Moves" (right hand side) calls Game.Queues which reads from Game.moves_queue (in app/CheaosQueues.tsx)
6. What triggers the green squares to disappear is hooked up to Game.GetOutstandingMoves, which reads the move_ids from Game.outstanding_player_moves and pulls the corresponding data from Move object collection.
My best given log lines is that Reboot is causing React to re-render, but somehow the data is stale. Given oddity 1, it seems that somehow the amount of data matters
Impact
How severely does this bug impact your use of Reboot?
- It's not having any negative impact
- It's annoying
- It's a serious problem
- It makes it impossible for me to use Reboot
Please explain why?
I expect Reboot-React library to give my application code the update.
Client
Please complete the following information:
- OS: mac 14.7
- Client: Firefox 138.0.4
- Client version:
npx rbt --version0.25.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working