Repository navigation
fix: validate timezone so an invalid value can't break the dashboard (#51) - #52
Closed
Carl723000 wants to merge 1 commit into
Closed
Carl723000 wants to merge 1 commit into
Carl723000 wants to merge 1 commit into
Conversation
…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>
3 tasks done
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. |
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.
Fixes #51.
Problem
Typing an invalid timezone in the settings (e.g.
EST-5 Detroit) stored it verbatim; it was then passed toIntl.DateTimeFormat({ timeZone }), which throwsInvalid 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.setTimezonenow validates the value (via a throwawayIntl.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-5pricing entry (Sonnet $3/$15 tier; already resolved via family inference, now explicit) since Sonnet 5 just shipped.tscclean;node --testgreen (addsi18nTimezone.test.ts).Follow-up idea (not here): a validated dropdown in the settings panel (
Intl.supportedValuesOf('timeZone')).🤖 Generated with Claude Code