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

[Darwin] MTRDevice writes and commands should be serialized along with reads #23066

Closed
jtung-apple opened this issue Oct 7, 2022 · 0 comments · Fixed by #23141
Closed

[Darwin] MTRDevice writes and commands should be serialized along with reads #23066

jtung-apple opened this issue Oct 7, 2022 · 0 comments · Fixed by #23141

Comments

@jtung-apple
Copy link
Contributor

Reproduction steps

With the MTRDevice set of APIs, with regard to reading/writing a value to an attribute, we can imagine a scenario:
1. Assume old value is X
2. Write A - fires async write A
3. Read - synchronous and immediately returns A, and fires async real read
4. Async read wins, returns old value X, expected value cache obliterated and we report to client old value X again
5. Async write eventually done
6. Subscription report gets received from device and value A is reported to client

Platform

darwin

Platform Version(s)

No response

Type

Manually tested with SDK

(Optional) If manually tested please explain why this is only manually tested

There does not currently exist unit tests for this.

Anything else?

Given an attribute that the user is interacting with actively, although the eventual value would be correct, the users could potentially see values jumping around incorrectly during change.

The fix here would be to also serialize writes and commands along with reads.

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