Skip to content

fix: validate timezone so an invalid value can't break the dashboard (#51) - #52

Closed
Carl723000 wants to merge 1 commit into
mainfrom
fix/timezone-validation
Closed

Carl723000 wants to merge 1 commit into
mainfrom
fix/timezone-validation

Conversation

@Carl723000

Copy link
Copy Markdown
Collaborator

Fixes #51.

Problem

Typing an invalid timezone in the settings (e.g. EST-5 Detroit) stored it verbatim; it was then passed to Intl.DateTimeFormat({ timeZone }), which throws Invalid time zone specified. That took down the whole dashboard (red Error in the tab and status bar), with no way to recover from the UI.

Fix

I18n.setTimezone now validates the value (via a throwaway Intl.DateTimeFormat) and falls back to the system zone on anything Intl rejects. So a bad value is simply ignored — the dashboard keeps working, and the user can correct the setting. Auto-recovers existing broken configs on next load.

Also bundles an explicit claude-sonnet-5 pricing entry (Sonnet $3/$15 tier; already resolved via family inference, now explicit) since Sonnet 5 just shipped.

tsc clean; node --test green (adds i18nTimezone.test.ts).

Follow-up idea (not here): a validated dropdown in the settings panel (Intl.supportedValuesOf('timeZone')).

🤖 Generated with Claude Code

…51)

A hand-typed invalid IANA zone (e.g. "EST-5 Detroit") was stored as-is and fed
to Intl.DateTimeFormat, which throws "Invalid time zone specified" — taking down
the whole dashboard with an Error. I18n.setTimezone now validates the zone and
falls back to the system zone on anything Intl rejects. Also adds an explicit
claude-sonnet-5 pricing entry (Sonnet $3/$15 tier; already covered by family
inference, now explicit). Unit-tested.

Co-Authored-By: Claude <noreply@anthropic.com>
@Carl723000

Copy link
Copy Markdown
Collaborator Author

Superseding this: folding the timezone fix into the V2.2 line as a proper validated dropdown (the reporter's own suggestion) rather than free-text + validation, and shipping it with 2.2.0 instead of a standalone patch. Sonnet 5 pricing goes there too.

@Carl723000 Carl723000 closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Accidentally setting invalid time zone breaks dashboard

1 participant