Summary
The ZimaOS web UI timezone selector truncates timezone names containing underscores, making it impossible to set timezones like Asia/Ho_Chi_Minh, Asia/Hong_Kong, America/New_York, etc. The UI converts underscores to spaces and truncates at the first space, sending invalid timezone identifiers to the backend.
Environment
- ZimaOS Version: v1.4.2
- Hardware: ZimaCube
- Build Date: 2025/08/01 13:41:23 UTC
- Kernel: Linux ZimaOS 6.12.25
Bug Description
When selecting a timezone with underscores (e.g., "Ho Chi Minh") from the web UI timezone selector, the frontend incorrectly processes the timezone name:
- Converts underscores to spaces:
Asia/Ho_Chi_Minh → Asia/Ho Chi Minh
- Truncates at first space:
Asia/Ho Chi Minh → Asia/Ho
- Sends invalid timezone to backend:
Asia/Ho
- Backend correctly rejects invalid timezone
- User sees truncated name but timezone never actually changes
Steps to Reproduce
- Access ZimaOS web interface
- Navigate to timezone settings
- Select "Ho Chi Minh" from timezone dropdown
- Observe that UI shows "Asia/Ho" instead of "Asia/Ho_Chi_Minh"
- Check system timezone via SSH:
timedatectl status
- Notice timezone hasn't actually changed
Expected vs Actual Behavior
Expected:
- UI should display full timezone name "Asia/Ho_Chi_Minh"
- Backend should receive valid timezone identifier
- System timezone should change successfully
Actual:
- UI displays truncated name "Asia/Ho"
- Backend receives invalid identifier "Asia/Ho"
- System timezone remains unchanged
- No error feedback to user
Evidence from System Logs
Aug 07 05:53:01 ZimaOS zimaos-user[1767]: error failed to set timezone {"timezone": "Asia/Ho", "error": "exit status 1"}
Aug 07 05:53:26 ZimaOS zimaos-user[1767]: error failed to set timezone {"timezone": "Asia/Ho", "error": "exit status 1"}
Affected Timezones
All timezone identifiers containing underscores, including but not limited to:
Asia/Ho_Chi_Minh → Asia/Ho ❌
Asia/Hong_Kong → Asia/Hong ❌
Asia/Kuala_Lumpur → Asia/Kuala ❌
Asia/Tel_Aviv → Asia/Tel ❌
America/New_York → America/New ❌
America/Los_Angeles → America/Los ❌
Pacific/Port_Moresby → Pacific/Port ❌
Workaround
Use SSH to set timezone via command line:
sudo timedatectl set-timezone Asia/Ho_Chi_Minh
Technical Details
- Affected Components: Frontend timezone selector UI component
- Backend Services:
/home/runner/work/ZimaOS-UserService/ZimaOS-UserService/service/user.go:142
/home/runner/work/ZimaOS-UserService/ZimaOS-UserService/route/v1/user.go:615
- Root Cause: String processing logic in frontend that replaces
_ with and truncates at first space
Suggested Fix
- Frontend: Remove underscore-to-space replacement logic in timezone selector
- Alternative: If display formatting is needed, keep original identifier for backend communication while showing formatted version to user
- Validation: Add frontend validation to ensure timezone identifiers exist before sending to backend
- Error Handling: Display error messages when timezone setting fails
Impact
- Severity: Medium-High (affects major cities/timezones)
- User Experience: Confusing and frustrating - users can't set their correct timezone
- Geographic Impact: Affects users in Vietnam, Hong Kong, Malaysia, Israel, USA, and many other regions
- Workaround Available: Yes (CLI), but requires technical knowledge
Additional Context
- Backend timezone service works correctly and properly validates timezone identifiers
- Issue is purely in frontend timezone selection component
- System time calculations work correctly once proper timezone is set via CLI
- Bug affects web UI only - CLI timezone setting works perfectly
Summary
The ZimaOS web UI timezone selector truncates timezone names containing underscores, making it impossible to set timezones like
Asia/Ho_Chi_Minh,Asia/Hong_Kong,America/New_York, etc. The UI converts underscores to spaces and truncates at the first space, sending invalid timezone identifiers to the backend.Environment
Bug Description
When selecting a timezone with underscores (e.g., "Ho Chi Minh") from the web UI timezone selector, the frontend incorrectly processes the timezone name:
Asia/Ho_Chi_Minh→Asia/Ho Chi MinhAsia/Ho Chi Minh→Asia/HoAsia/HoSteps to Reproduce
timedatectl statusExpected vs Actual Behavior
Expected:
Actual:
Evidence from System Logs
Affected Timezones
All timezone identifiers containing underscores, including but not limited to:
Asia/Ho_Chi_Minh→Asia/Ho❌Asia/Hong_Kong→Asia/Hong❌Asia/Kuala_Lumpur→Asia/Kuala❌Asia/Tel_Aviv→Asia/Tel❌America/New_York→America/New❌America/Los_Angeles→America/Los❌Pacific/Port_Moresby→Pacific/Port❌Workaround
Use SSH to set timezone via command line:
Technical Details
/home/runner/work/ZimaOS-UserService/ZimaOS-UserService/service/user.go:142/home/runner/work/ZimaOS-UserService/ZimaOS-UserService/route/v1/user.go:615_withand truncates at first spaceSuggested Fix
Impact
Additional Context