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

Incorrect timezone is being chosen in FirstUse #2

Open
Herrie82 opened this issue Jan 25, 2022 · 9 comments
Open

Incorrect timezone is being chosen in FirstUse #2

Herrie82 opened this issue Jan 25, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Herrie82
Copy link
Collaborator

Describe the bug
The timezone chosen in FirstUse is incorrect, probably due to a change in the timezone data provided.

To Reproduce
In FirstUse select your country, when you come to the timezone page you'll notice it doesn't show or select the correct timezone.

Expected behavior
The correct timezone should be automatically selected based on country or available MCC/MNC when a SIM is present.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: All targets
  • OS: LuneOS
  • Version: 20220125

Additional context
Add any other context about the problem here.

@Herrie82 Herrie82 self-assigned this Jan 25, 2022
@Herrie82 Herrie82 added the bug Something isn't working label Jan 25, 2022
@Herrie82
Copy link
Collaborator Author

It seems that no offset is being populated for the countries anymore. Need to check luna-init to see if something needs updating in the timeZone files etc

@Herrie82
Copy link
Collaborator Author

Herrie82 commented Jan 2, 2024

@Tofee
Copy link
Member

Tofee commented Jan 2, 2024

Mmh both the new and the old code look good... It would need a pass in a debugger I think, to see more clearly what happens there.

@Herrie82
Copy link
Collaborator Author

Herrie82 commented Jan 2, 2024

A bit weird here... The value is shown correctly in another call:

root@qemux86-64:/var/luna/preferences# luna-send -f -n 1 luna://com.palm.systemservice/time/getSystemTime '{}'
{
    "returnValue": true,
    "timezone": "Europe/Amsterdam",
    "localtime": {
        "month": 1,
        "day": 2,
        "hour": 15,
        "year": 2024,
        "minute": 15,
        "second": 21
    },
    "TZ": "CET",
    "offset": 60,
    "systemTimeSource": "ntp",
    "utc": 1704204921,
    "isDST": false,
    "timeZoneFile": "/var/luna/preferences/localtime",
    "timestamp": {
        "source": "monotonic",
        "sec": 14824,
        "nsec": 287385799
    }
}
root@qemux86-64:/var/luna/preferences# luna-send -f -n 1 luna://com.palm.systemservice/getPreferences '{"keys": ["region", "timeZone", "timeFormat", "locale"]}'
{
    "timeZone": {
        "ZoneID": "Europe/Amsterdam",
        "Country": "Netherlands",
        "supportsDST": 0,
        "offsetFromUTC": 0,
        "CountryCode": "NL",
        "Description": "Central European Time",
        "City": "Amsterdam"
    },
    "subscribed": false,
    "timeFormat": "HH12",
    "returnValue": true,
    "locale": {
        "languageCode": "en",
        "countryCode": "us",
        "phoneRegion": {
            "countryCode": "us",
            "countryName": "United States"
        }
    },
    "region": {
        "countryCode": "nl",
        "countryName": "Netherlands"
    }
}

@Herrie82
Copy link
Collaborator Author

Herrie82 commented Jan 2, 2024

luna-send -n 1 luna://com.palm.systemservice/getPreferenceValues '{"key": "timeZone"}' also shows the incorrect value

@Herrie82
Copy link
Collaborator Author

Herrie82 commented Jan 2, 2024

Ok seems issue might be in https://github.com/webosose/luna-init/blob/master/src/gen-ext-timezones.py

The generated ext-timezones.json doesn't contain the correct offsetFromUTC. Culprit is likely https://github.com/webosose/luna-init/blob/master/src/gen-ext-timezones.py#L121

@Herrie82
Copy link
Collaborator Author

Herrie82 commented Jan 2, 2024

OK seems we need a new syntax in Python3: https://stackoverflow.com/questions/15940280/how-to-get-utc-time-in-python

I'll prepare a fix

@Herrie82
Copy link
Collaborator Author

Herrie82 commented Jan 2, 2024

Seems I have a rebased and patched luna-init from OSE already in the works. Will test that first and add it to that PR

@Herrie82
Copy link
Collaborator Author

Mostly solved now, just the selection of the correct timezone based on the country isn't working (anymore). Need to debug it a bit further:

https://github.com/webOS-ports/org.webosports.app.firstuse/blob/master/qml/TimeZonePage.qml#L169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants