Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromium-based apps can't read timezone in certain timezone #163

Open
peat-psuwit opened this issue Jan 3, 2024 · 2 comments
Open

Chromium-based apps can't read timezone in certain timezone #163

peat-psuwit opened this issue Jan 3, 2024 · 2 comments
Assignees

Comments

@peat-psuwit
Copy link

peat-psuwit commented Jan 3, 2024

Step to reproduce:

  1. Setup an Ubuntu Core 22 VM. Then, set timezone to "Asia/Bangkok": sudo timedatectl set-timezone Asia/Bangkok.
  2. Install ubuntu-frame. Then, build and install the Electron version of iot-example-graphical-snap [1].
  3. Start the snap. Go to "View > Toggle Developer Tools". Then, go to "Console" tab and type: new Date().
  • Expected result: the time is 7 hours ahead of UTC, and ends with "GMT+0700 (Indochina Time)".
  • Actual result: the time is in UTC, and ends with "GMT+0000 (GMT)".

I have a full analysis, done under Ubuntu Touch which also use writable-paths system, at [2]. But basically, ICU tries to determine the timezone by reading symlink target of /etc/localtime, which then fails. This isn't failure on its own (it can still understand +07 from GLibC), but then Chromium tries to pass +07 to Zygote process, which ICU can't deserialize back to a timezone falling back to Etc/Unknown.

We can either patch ICU so that it understand /etc/writable redirection (similar to what we've done with systemd), or patch Chromium to correct the passed zone ID (to something like GMT+07) turns out you can't do that because of time zone abbreviation collision (e.g. PST = Pacific Standard Time = Philippines Standard Time). I feel like patching ICU could have a wider effect and would make stuff more functional.

To see the effect of the ICU problem alone, installs wpe-webkit-mir-kiosk instead and run snap set wpe-webkit-mir-kiosk url="https://www.w3schools.com/js/tryit.asp?filename=tryjs_date_current".

[1] https://github.com/MirServer/iot-example-graphical-snap/tree/22/Electron-quick-start
[2] https://gitlab.com/ubports/development/core/packaging/qtwebengine/-/issues/15

@peat-psuwit
Copy link
Author

Ping the developer.

@peat-psuwit
Copy link
Author

Ping the developers.

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

No branches or pull requests

2 participants