feat(web): add last seen to authorized clients - #9798
Open
extoci wants to merge 2 commits into
Open
Conversation
extoci
force-pushed
the
t3code/show-client-last-seen
branch
from
September 4, 2026 21:29
9ba3d23 to
e3e3df3
Compare
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This feature changes production authorized-session persistence and adds user-facing behavior in the settings UI, including logic in a sensitive auth directory. An unresolved Medium finding also questions the timestamp semantics, so the runtime behavior should receive human validation. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
extoci
force-pushed
the
t3code/show-client-last-seen
branch
from
September 4, 2026 22:07
4834e3f to
5762c9e
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.
What Changed
Adds a relative "Last seen" line to each authorized client.
Live sessions show "Last seen now". Older sessions show values such as "Last seen 12m ago". Sessions without a timestamp show "Never seen".
UI Changes
Before:
After:
Checklist
Checks: targeted timestamp tests and web typecheck passed.
Built by Codex on behalf of Exotic using GPT-5.6 Sol in T3 Code.
Note
Medium Risk
Changes persisted semantics of
lastConnectedAton auth sessions, which may affect other readers of that field beyond the new UI.Overview
Adds a Last seen line on each authorized client in Connections settings, using relative time when offline and Last seen now while the session is live (or Never seen when no timestamp exists).
To support that,
SessionStorenow persistslastConnectedAtwhen a session’s last connection drops (ref-count hits zero), not only on the first connect. Partial disconnects (e.g. one of several sockets) leave the timestamp and connected state unchanged; a full disconnect writes the disconnect time, and a later reconnect updates it again. Connect path is refactored to share asetLastConnectedAtNowhelper.Note: anything that treated
lastConnectedAtas “when the client last connected” will now see the final disconnect time for idle sessions instead.Reviewed by Cursor Bugbot for commit 5762c9e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add last-seen timestamp tracking to authorized client connections
markDisconnectedinSessionStorenow persists the current time tolastConnectedAtonly when the final connection reference disconnects; intermediate disconnects just decrement the count.ConnectedClientListRowin the web settings displays a last-seen label: live clients show "Last seen now", disconnected clients show a relative time, and clients without a timestamp show "Never seen".lastConnectedAtis now updated on final disconnect rather than only on connect, so consumers reading that field may see disconnect times where they previously saw the last connection start time.Macroscope summarized 5762c9e.