Skip to content

feat(settings): add remote "Set time" admin action#5821

Merged
jamesarich merged 1 commit into
mainfrom
claude/romantic-chatelet-2cb854
Jun 17, 2026
Merged

feat(settings): add remote "Set time" admin action#5821
jamesarich merged 1 commit into
mainfrom
claude/romantic-chatelet-2cb854

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

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

  • "Set time" remote admin action. New AdminRoute.SET_TIME entry (clock icon + set_time string) 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.
  • Behavior matches the existing admin actions: the flow runs the SESSIONKEY_CONFIG preflight first (which seeds the remote session passkey), then sends the command; completion rides the routing ACK exactly like reboot/shutdown.

🛠️ Refactoring & Architecture

  • Added setTime(destNum, packetId) to the AdminController interface and AdminControllerImpl, which sends AdminMessage(set_time_only = <current epoch seconds>) via the existing CommandSender. The timestamp is resolved at send time (using the shared nowSeconds accessor) so it is as fresh as possible when it leaves the phone. This mirrors the SDK AdminApi boundary and the Python CLI's Node.setTime.
  • Added AdminActionsUseCase.setTime(destNum) and wired the AdminRoute.SET_TIME branch in RadioConfigViewModel.sendAdminRequest.
  • Fire-and-forget by design: set_time_only has no admin response (consistent with the local-node time-set already sent during the connection handshake).

🧹 Chores

  • Added the set_time string resource and re-ran scripts/sort-strings.py (regenerates strings-index.txt).
  • Added the setTime no-op override to the FakeRadioController test double.

Testing Performed

  • Added setTimeSendsAdminMessageWithCurrentEpochSeconds to RadioControllerImplTest, which captures the sent AdminMessage and asserts set_time_only is populated with a plausible recent epoch timestamp.
  • Ran the full baseline locally — all green: spotlessApply spotlessCheck detekt assembleDebug test allTests kmpSmokeCompile.

@github-actions github-actions Bot added the enhancement New feature or request label Jun 17, 2026
@jamesarich jamesarich marked this pull request as ready for review June 17, 2026 00:48
@jamesarich jamesarich added this to the 2.8.0 milestone Jun 17, 2026
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>
@jamesarich jamesarich force-pushed the claude/romantic-chatelet-2cb854 branch from 4d94dc2 to 5863e0c Compare June 17, 2026 02:01
@jamesarich jamesarich enabled auto-merge June 17, 2026 02:01
@jamesarich jamesarich added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit cef12c3 Jun 17, 2026
18 checks passed
@jamesarich jamesarich deleted the claude/romantic-chatelet-2cb854 branch June 17, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Allow remote time setting of slave nodes

1 participant