Termix-SSH / Termix-SSH/Support
[BUG] Clock widget crashes the homepage canvas when the timezone is not a valid IANA name
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 28
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Title
Clock widget throws RangeError and breaks the homepage when given an invalid timezone
Platform
Website - Chrome
Server Installation Method
N/A
Version
2.7.1
CLI Installation Method
None
CLI Version
No response
Troubleshooting
- I have examined logs and tried to find the issue
- I have reviewed opened and closed issues
- I have tried restarting the application
- I have checked open issues and ensured this is not a duplicate
The Problem
The Clock widget passes config.timezone straight into toLocaleTimeString / Intl.DateTimeFormat without validating it. Any string that is not a usable IANA zone name throws:
RangeError: Invalid time zone specified: America/New York
The throw happens during render, so the widget takes the homepage canvas down with it rather than failing on its own.
The timezone field in the widget's edit dialog accepts and saves any text, with no validation and no feedback, so a config that permanently breaks the homepage is easy to create by accident. The most common way in is a space instead of an underscore - "America/New York" rather than "America/New_York" - which is how the zone reads everywhere except IANA.
Once such a config is saved, the homepage stays broken on every subsequent load until the widget is removed or the config is edited back, since the bad value is reloaded from the database each time.
Still present on dev-2.8.0: ClockWidget.tsx destructures the raw timezone out of config, and ClockEditForm.tsx renders a plain Input with no validation.
How to Reproduce
- Open the Homepage tab and add a Clock widget (right-click the canvas -> Add Widget -> Info -> Clock).
- Hover the widget and click the pencil (Edit) icon.
- Set Timezone to "America/New York" (with a space) and click Save.
- The clock throws
RangeError: Invalid time zone specifiedand the homepage canvas fails to render. Reloading the page does not help, because the invalid value is persisted.
Additional Context
Server is the Linux Desktop App build (/opt/Termix), with the UI running against it in Chrome, which is why Server Installation Method is N/A.
Any unusable zone string reproduces it, not just the space case: "Not/AZone" does the same. A blank field is fine and correctly means local time.
I have a fix ready and will open a PR against dev-2.8.0: validate the zone in the edit dialog (inline error plus a disabled Save, matching how FolderMetadataDialog handles a duplicate folder name), normalize whitespace to underscores on save, and make ClockWidget fall back to local time for any config already stored with an invalid zone.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ClockWidget.tsx and ClockEditForm.tsx, then compare the validation behavior in FolderMetadataDialog. Reproduce the saved invalid-zone case on the homepage and verify that invalid input is rejected with feedback, valid input is normalized as specified, and existing invalid configurations no longer crash the canvas.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100