Skip to content

[bug]Keep auth status dates stable across timezones#1407

Merged
Soph merged 2 commits into
entireio:mainfrom
stale2000:stale2000/fix-auth-status-date-timezone
Jun 15, 2026
Merged

[bug]Keep auth status dates stable across timezones#1407
Soph merged 2 commits into
entireio:mainfrom
stale2000:stale2000/fix-auth-status-date-timezone

Conversation

@stale2000

@stale2000 stale2000 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Entire logs: https://entire.io/gh/stale2000/cli/session/019eb399-2d0c-7a52-bd77-ee57e66eb3fe#timeline-c93f3cd1bb07

Summary

entire auth status rendered active-session dates after converting server RFC3339 timestamps into the user's local timezone. That is correct for a full local datetime, but this UI only shows a date, so users west of UTC could see session dates shifted one day earlier than the server-provided date.

Example

Server session timestamp:

2026-01-01T00:00:00Z

The old formatter parsed that timestamp, called Local(), then rendered only YYYY-MM-DD.

For a user in America/Los_Angeles, the same instant becomes:

2025-12-31 16:00:00 PST

Because the table hides the time and timezone, the user only saw:

2025-12-31

That made the CREATED, LAST USED, and EXPIRES columns appear one day early even though the server timestamp was correct.

Fix

Format the parsed RFC3339 timestamp in its encoded timezone instead of converting it through Local() first. For server UTC timestamps, this preserves the server calendar date:

2026-01-01T00:00:00Z -> 2026-01-01

This keeps the date-only auth status table stable across user timezones. If we later want true local-time semantics, the UI should show a full local datetime including time and timezone context.

Tests

  • Added a regression test that forces time.Local to PST and verifies 2026-01-01T00:00:00Z still renders as 2026-01-01.
  • Verified the existing sessions table test under TZ=America/Los_Angeles.
TZ=America/Los_Angeles go test ./cmd/entire/cli -run 'TestRunAuthStatus_RendersSessionsTable|TestFormatAuthDate_DoesNotShiftUTCDateToLocalTimezone' -count=1 -v
go test ./cmd/entire/cli -count=1
mise run check
mise run lint

The auth status session table displays date-only values from server RFC3339 timestamps. Converting those instants through the local timezone before dropping the time made midnight UTC sessions appear one day early for users west of UTC.

Constraint: Auth session timestamps are server-provided RFC3339 values and the table renders only YYYY-MM-DD, not a full local datetime.

Rejected: Keep Local() and expand the table to include local time | broader UX change than needed for this display-only bug.

Confidence: high

Scope-risk: narrow

Directive: Do not reintroduce Local() here unless the UI also shows time and timezone context.

Tested: TZ=America/Los_Angeles go test ./cmd/entire/cli -run 'TestRunAuthStatus_RendersSessionsTable|TestFormatAuthDate_DoesNotShiftUTCDateToLocalTimezone' -count=1 -v; go test ./cmd/entire/cli -count=1; mise run check

Not-tested: Manual auth status against a live core
Entire-Checkpoint: c93f3cd1bb07
@stale2000 stale2000 requested a review from a team as a code owner June 10, 2026 22:27
@stale2000 stale2000 changed the title Keep auth status dates stable across timezones [bug]Keep auth status dates stable across timezones Jun 10, 2026
@Soph Soph enabled auto-merge June 15, 2026 16:13

@Soph Soph left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙇

@Soph Soph merged commit c08ed8f into entireio:main Jun 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants