Fix device online status flickering
- Dominant language
- JavaScript
- Stars
- 134
- Forks
- 95
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 25
Description
Devices can flicker between online and offline while they are reachable.
The online state has multiple competing writers:
* device refreshes use the server-provided `last_athena_ping`
* successful auxiliary Athena RPCs set it to `now`
* failed auxiliary Athena RPCs set it to `0`
These requests race, so whichever response finishes last controls presence. Individual RPC failures shouldn't mark the whole device offline; presence should come from one authoritative source.
There's also a condition in the network status probe that appears to classify nearly every error as offline:
https://github.com/commaai/connect/blob/868c259caaa730bbb0c77f5fd880f16cf382a631/src/actions/index.js#L412-L413
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/actions/index.js around lines 412-413, then trace the device refresh and auxiliary Athena RPC paths named in the issue. Reproduce overlapping successful and failed requests and inspect which responses update presence. Done means individual RPC failures no longer cause reachable devices to flicker offline and the network probe classifies errors correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100