Skip to content

[Bug]: Client not in sync with torii grpc #247

Closed
@rsodre

Description

@rsodre

Dojo.js Version

1.0.0-alpha.0

What happened?

Components in the react examples are not being updated from torii.
I'using the code below on my setup, as documented.

const sync = await getSyncEntities(
    toriiClient,
    contractComponents as any,
    []
);

What is the expected behavior?

Components / game state should always be in sync with torii.

Steps to reproduce

The react-phaser-example example seems to be the only one not using overrides.
It relies on getSyncEntities() as exemplified above.

  • Deploy dojo starter locally
  • Run torii locally
  • run the phaser client
  • try to move the rock (WASD keys).
  • Look at torii logs, it is being indexed!
  • Game state is not updated.

As a side note, I understand overrides are useful sometimes, but we have to replicate game logic off-chain.
Moving a square on the screen is a good override example, but should not be THE Dojo example.
Newcomers will think we have to override every call, otherwise it will not be updated. That's a mistake I made when I started with Dojo, and it gave me a lot of headaches and fud on Torii.
It is my opinion there should be one specific example explaining how to do overrides, all the others should rely on Torii as the norm.

Trace

No response

Is there an existing issue for this?

  • I have searched the existing issues and verified no issue exits for this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions