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

Rapid NumberEntity increment / decrement causes value override #40

Open
DanielBaulig opened this issue Feb 28, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@DanielBaulig
Copy link
Owner

This fundamentally probably also applies to other entities, but it's very apparent on NumberEntity, when using the up/down arrows.

Since NumberEntity uses set(v) to set the new value, the value used to update the entity is the most recent value displayed in the ResponsiveInput. This is fine, until multiple updates are queued and the new values return asynchronously causing the input to jump back to older values while still incrementing/decrementing.

I see two ways how to solve this:

  1. Implement a decrement/increment method in web_server that can increment/decrement the NumberEntity by a specific amount independent from it's current value. Note that this would still cause the input to "flicker" in value, but would have eventual consistency.
  2. Implement some form of optimistic/delayed update that disregards state updates while we are still awaiting "responses" from previous state updates. It's not clear at this point how to cleanly and reliably implement this.
@DanielBaulig DanielBaulig added the bug Something isn't working label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant