You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: make the wear send hold and spark disconnect atomic #2185
On the watch, WatchSparkService.holdSend() and disconnect() are not atomic: the held-send count is read outside the service mutex. A send that takes its hold just after disconnect checked the count runs on a disconnected SDK and ends as unknown, keeping its note, although it most likely never left.
It is safe (unknown, the note kept, no second payment) and needs a pause, lock or wipe in a window of a few milliseconds.
Proposal
Let holdSend coordinate with disconnect under the mutex and fail with not-ready when a disconnect has begun.
Done when
A unit test interleaves a hold and a disconnect and gets not-ready, with the note dropped.
Found in review round 3 of the Wear OS payments PR.
Activity