Changing a value of an item inside an ArraySchema is not sent to the client
See original GitHub issueIssue Description
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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Mongoose, update values in array of objects - Stack Overflow
Problem with this approach is that it updates/sets the entire object, therefore in this case I lose the id field. Is there a...
Read more >Schema - Colyseus & Arena Cloud Documentation
Returns a boolean value wheter an item exists in the Collection or not. if (set.has("two")) { console.log ...
Read more >ArraySchema annotation on model accessors doesn't map to ...
I'm using swagger-core 2.0.0 with Jackson 2.9.4 and Jersey 2.26. I'll start that I'm learning-by-doing, and so it's possible I'm doing it ...
Read more >@colyseus/schema - npm
@colyseus/schema encodes only field values in the specified order. Both encoder (server) and decoder (client) must have same schema definition.
Read more >Understanding JSON Schema
Most of the work of writing a JSON Schema involves mapping a special “keyword” to a value within an object. For example, in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Problem was indeed solved by migrating to 0.14!
That’s awesome. Thank you!
I’ll go ahead and try migrating again if it is going to be released so soon.