vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
919 stars 58 forks source link

[Full-stack Signals] changes to ValueSignal should be applied locally without waiting for server acceptance #2840

Open taefi opened 2 weeks ago

taefi commented 2 weeks ago

Describe the bug

ValueSignal should support applying the changes locally without waiting for the server acceptance.

Expected-behavior

To see the changes applied to the local value without waiting for the acceptance to be received from the server. Apart from the normal way of assigning to the value property or calling the set function which does the same as direct value assignment, ValueSignal provides two more ways of setting the value: replace and update, and all of them are supposed to support this.

Reproduction

Having a subscription to ValueSignal, attempt a replace or an update on the signal, while having a breakpoint in SignalsHandler::update endpoint to make it blocked, it can be detected that the change isn't applied locally in the browser, waiting for the event to be processed on the server.

System Info

N/A

taefi commented 1 week ago

According to internal discussion, this will be put on hold (or may be closed), until the latency compensation could be implemented based on the local stack of pending changes and an event log.