Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing a value of an item inside an ArraySchema is not sent to the client #368

Closed
DimosthenisK opened this issue Oct 19, 2020 · 5 comments

Comments

@DimosthenisK
Copy link

Trying to change the value of an item inside an ArraySchema changes the state correctly, but the client doesn't get the change in the onStateChange listener.

execute({ sessionId, cardIndex }: this['payload']) {
    const player = this.state.players[sessionId] as Models.Player;
    player.hand.cards[cardIndex].isSelected = true;
    console.log(player.hand.cards[cardIndex].isSelected); //true as expected, still false in client
  }

I tried both with and without filters on version 0.14.

@endel
Copy link
Member

endel commented Oct 19, 2020

Hi @DimosthenisK, thanks for trying out the version 0.14 alpha.

I've tried and failed to reproduce this issue you described though. Can you fork this and try to break it as it does in your project? https://github.com/endel/colyseus-issue-368

Thanks!

@DimosthenisK
Copy link
Author

Hi @endel ! Thanks for taking the time to check out my issue.

I am very very sorry, I meant 0.13. I tried migrating to 0.14 but something wasn't working correctly and I had to drop it.

Is it possible that 0.14 fixes this issue? Should I try migrating again?

@endel
Copy link
Member

endel commented Oct 19, 2020

You're welcome, I see, that's very likely! Feel free to try it out and let me know if 0.14 works for you! It is going to be released this week anyway :)

@DimosthenisK
Copy link
Author

That's awesome. Thank you!

I'll go ahead and try migrating again if it is going to be released so soon.

@DimosthenisK
Copy link
Author

Problem was indeed solved by migrating to 0.14!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants