Closed Bug 1678839 Opened 3 months ago Closed 3 months ago

Wrong timezone guess for Moscow

Categories

(Calendar :: General, defect)

defect

Tracking

(thunderbird_esr78+ fixed)

RESOLVED FIXED
85 Branch
Tracking Status
thunderbird_esr78 + fixed

People

(Reporter: cas, Assigned: cas)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36

Steps to reproduce:

I try to use calendar in Thunderbird in Moscow and guessed timezone was empty in calendar settings.

Actual results:

There are two problem in comm/calendar/base/src/CalTimezoneService.jsm

  1. Program read only first 10 lines from /etc/sysconfig/clock. But there is Zone=Europe/Moscow in 18 line in ALT Linux distribution.
  2. Function guessSystemTimezone() use year 2005 for check timezone rule. But Europe/Moscow timezone rule changed since 2005.

Expected results:

I prepare patch to fix problems. I guess better use current year for check timezone rule.

Component: Untriaged → General
Product: Thunderbird → Calendar
Version: 78 → unspecified

+1 for this, thanks, this patch has fixed detecting timezone on ROSA in Thunderbird 78 as well (it was not detected without it, and Europe/Moscow was correctly detected with it), but it will work until next change of timezone rules.

Thanks for the patch!

Assignee: nobody → cas
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Summary: Wrong guess timezone in calendar → Wrong timezone guess for Moscow
Attachment #9189353 - Flags: review?(geoff)
Comment on attachment 9189353 [details] [diff] [review]
thunderbird-fix-guess-timezone-in-calendar.patch

Review of attachment 9189353 [details] [diff] [review]:
-----------------------------------------------------------------

::: thunderbird/comm/calendar/base/src/CalTimezoneService.jsm
@@ +264,4 @@
>      if (!this.mDefaultTimezone) {
>        let prefTzid = Services.prefs.getStringPref("calendar.timezone.local", null);
>        let tzid = prefTzid;
> +      if (!tzid || tzid == "floating") {

Why this change?

If user already has profile made earlier version with floating timezone, it set correctly guessed timezone.

Could be worth adding a code comment about that.

(In reply to Magnus Melin [:mkmelin] from comment #5)

Could be worth adding a code comment about that.

Well, how do I do it? Add corrected patch to bugzilla?

Yep, just upload a new patch. During the upload process it will ask if the new patch obsoletes older patches. There, mark the old one as obsolete.

While you're at it, please make sure to add a proper patch header with your user info etc for proper attribution, that is, what you get by hg export when you've configured hg so that it knows your name and email.

This is corrected patch from mercurial export.

  • Added commect for floating status check.
  • Use current year for check timezone rule.
Attachment #9189353 - Attachment is obsolete: true
Attachment #9189353 - Flags: review?(geoff)

Don't forget to set the review flag. (I'll do it for you now)

Attachment #9190537 - Flags: review?(geoff)
Attachment #9190537 - Flags: review?(geoff) → review+

Sorry, I use review flag for a fist time.

Comment on attachment 9190537 [details] [diff] [review]
thunderbird-fix-guess-timezone-in-calendar.patch

Review of attachment 9190537 [details] [diff] [review]:
-----------------------------------------------------------------

review? geoff@ means he should review it. Once he approves, he'll set it to +
(https://developer.thunderbird.net/thunderbird-development/fixing-a-bug#ask-for-a-review)
Attachment #9190537 - Flags: review+ → review?(geoff)

(In reply to Andrey Cherepanov from comment #4)

If user already has profile made earlier version with floating timezone, it set correctly guessed timezone.

I can see what it does, but I still don't understand why it does it or what it's got to do with this bug.

(In reply to Geoff Lankow (:darktrojan) from comment #12)

(In reply to Andrey Cherepanov from comment #4)

If user already has profile made earlier version with floating timezone, it set correctly guessed timezone.

I can see what it does, but I still don't understand why it does it or what it's got to do with this bug.

I set Europe/Moscow as system timezone, ran Thunderbird on empty profile and got empty timezone field in Calendar settings. There is "floating" value in jsconsole.

Comment on attachment 9190537 [details] [diff] [review]
thunderbird-fix-guess-timezone-in-calendar.patch

I'm a little wary of changing the pref if it already has a value, but "floating" is probably a bad value, so okay.

Attachment #9190537 - Flags: review?(geoff) → review+

Somebody will come along and land this soon. Congratulations on your first patch!

FYI for next time, we start commit messages with the bug number, so it would be "Bug 1678839 - Fix guess timezone in calendar". No need to update this patch, the person landing it will do so.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/5c130de114a6
Fix guess timezone in calendar. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

Comment on attachment 9190537 [details] [diff] [review]
thunderbird-fix-guess-timezone-in-calendar.patch

[Approval Request Comment]
User impact if declined: wrong time-zone guess at least for Moscow

Attachment #9190537 - Flags: approval-comm-esr78?

Comment on attachment 9190537 [details] [diff] [review]
thunderbird-fix-guess-timezone-in-calendar.patch

[Triage Comment]
Approved for esr78

Attachment #9190537 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.