feat(settings): add remote "Set time" admin action#5821
Merged
Conversation
Even with an RTC, nodes drift over time. This adds a "Set time" action to the remote Administration section that sends an accurate AdminMessage(set_time_only = <current epoch seconds>) to a node, so a user can correct a drifted clock on a remote node without being on-site or using the CLI. Mirrors the Python CLI's Node.setTime. Resolves #5789 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4d94dc2 to
5863e0c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Even with an RTC, nodes lose accurate time over the long run. This adds a one-tap Set time action to the remote Administration section so a user can push an accurate clock to a drifted node without being on-site or dropping to the CLI.
Resolves #5789
🌟 New Features
AdminRoute.SET_TIMEentry (clock icon +set_timestring) at the top of the Administration screen. Tapping it shows the standard confirmation dialog and, on confirm, sends the phone's current time to the selected node.SESSIONKEY_CONFIGpreflight first (which seeds the remote session passkey), then sends the command; completion rides the routing ACK exactly likereboot/shutdown.🛠️ Refactoring & Architecture
setTime(destNum, packetId)to theAdminControllerinterface andAdminControllerImpl, which sendsAdminMessage(set_time_only = <current epoch seconds>)via the existingCommandSender. The timestamp is resolved at send time (using the sharednowSecondsaccessor) so it is as fresh as possible when it leaves the phone. This mirrors the SDKAdminApiboundary and the Python CLI'sNode.setTime.AdminActionsUseCase.setTime(destNum)and wired theAdminRoute.SET_TIMEbranch inRadioConfigViewModel.sendAdminRequest.set_time_onlyhas no admin response (consistent with the local-node time-set already sent during the connection handshake).🧹 Chores
set_timestring resource and re-ranscripts/sort-strings.py(regeneratesstrings-index.txt).setTimeno-op override to theFakeRadioControllertest double.Testing Performed
setTimeSendsAdminMessageWithCurrentEpochSecondstoRadioControllerImplTest, which captures the sentAdminMessageand assertsset_time_onlyis populated with a plausible recent epoch timestamp.spotlessApply spotlessCheck detekt assembleDebug test allTests kmpSmokeCompile.