fix(timezone): default to UTC instead of browser timezone#509
Conversation
Previously the provider auto-detected and persisted the browser timezone when no preference was saved. Now the fallback stays UTC; users can still opt into their browser timezone from settings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
LGTM — straightforward removal of the auto-detect-and-persist effect, falling back to UTC as intended.
What was reviewed: the removed effect's only side effects (setTimezoneState/persistTimezone) are cleanly deleted with no dangling references; confirmed getBrowserTimezone remains used elsewhere (time-range-picker, account timezone settings' "Use browser timezone" button) so removing the import here doesn't break those; the provider still falls back to DEFAULT_TIMEZONE (UTC) for both initial state and SSR.
Extended reasoning...
Overview
Single-file change in src/features/dashboard/timezone/context.tsx that removes a useEffect which previously auto-detected the browser's timezone on first load and persisted it via a POST to /api/timezone/state. The provider now simply keeps the UTC default when no saved preference exists, matching the PR title/description.
Security risks
None. This only changes client-side default behavior for displaying timestamps; no auth, permissions, or data exposure surface is touched.
Level of scrutiny
Low. The diff is a pure deletion of an effect (net -9 lines), no new logic introduced, no new API surface, and the removed code path's only consumer (persist + local state) is fully deleted together — no orphaned references.
Other factors
Verified getBrowserTimezone is still imported and used by timezone-settings.tsx (the opt-in "Use browser timezone" button) and by time-range-picker.logic.ts, so the PR doesn't silently break those flows. No outstanding review comments in the timeline; only a Vercel bot preview-deployment comment.
When a user has no saved timezone preference, the dashboard now falls back to UTC instead of auto-detecting and persisting the browser's local timezone.
DEFAULT_TIMEZONE(UTC), both server- and client-side.🤖 Generated with Claude Code