-
Notifications
You must be signed in to change notification settings - Fork 178
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
fix(app): sync robot time with app time on connect #6501
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #6501 +/- ##
=======================================
Coverage ? 56.56%
=======================================
Files ? 1073
Lines ? 16549
Branches ? 0
=======================================
Hits ? 9361
Misses ? 7188
Partials ? 0
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the robot is on an older software version, GET /system/time will 404
The app will only try to send the PUT if the GET succeeds
We could (should?) add systemTime to the health links so we can check capabilities ahead of time
Until then, the 404 will show up in the logs like it does when the app tries to fetch calibration data from out of date robots
I'll make a (follow-up) PR to add systemTime to health links now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
A robot connection correctly updates time or does nothing, based on robot's time status.
Approved pending that test mentioned by @amitlissack
…system/time links Addresses #6501
Overview
This PR wires the app up to the time endpoints added in #6403. When the app requests to connect over RPC, it will also hit
GET /system/time
and, if the time is mismatched by more than 60 seconds, the app will send aPUT /system/time
request to get things sync'd.Closes #3872
Changelog
Review requests
Smoke test:
systemctl disable systemd-timesyncd
date -s 10:10
GET /system/time
request goes outPUT /system/time
request goes outdate
in the robot's terminal reports the same time (in UTC) as your computerGET /system/time
request went outPUT /system/time
request does not go out because time is already syncedRisk assessment
Medium low. Thoughts + notes:
timesyncd
is running and the robot has NTP access, the NTP time will be reasserted quite quicklyGET /system/time
will 404PUT
if theGET
succeedssystemTime
to the health links so we can check capabilities ahead of time