Closed Bug 437692 Opened 16 years ago Closed 13 years ago

Timezone picker is operable but shows blank entries if timezone extension is disabled

Categories

(Calendar :: Preferences, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Unassigned)

References

Details

Attachments

(1 file)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15pre) Gecko/2008060611 Calendar/0.9pre

Steps to Reproduce:
===================
1. Start Sunbird with new profile
2. Open Tools -> Add-ons and disable Timezone Definitions for Mozilla Calendar
3. Restart Sunbird
4. Open Tools -> Options -> Timezones

Actual Results:
===============
Timezone picker is displayed and operable but shows only blank entries. Error Console shows:

Info: using [...]\extensions\calendar-timezones@mozilla.org\timezones.sqlite

Info: No chrome package registered for chrome://calendar-timezones/locale/timezones.properties

Error: Assert failed: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIStringBundle.GetStringFromName]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: file:///[...]/js/calTimezoneService.js :: calIntrinsicTimezone_get_displayName :: line 66"  data: no]

Expected Results:
=================
Although the timezone extension is disabled the database file timezones.sqlite are still present. Therefore the timezone service opens it, reads it and works as normally. 

But when trying to get a localized name for the timezone picker it fails because the extensions is disabled and the timezones.properties file is not registered.

I suggest to fallback to the Olson names in that case, e.g. "Europe/London".
I think we're better off defining a proper dependency, so users wouldn't be permitted to disable/deinstall calendar-timezones.xpi.
IMO the proper way would probably be
- for lightning to em:require calendar-timezones.xpi
- for sunbird to extend the lightning stub to em:require calendar-timezones.xpi

I think this should be part of the works on bug 437441.
Depends on: 437441
OS: Windows XP → All
Hardware: PC → All
Falling back to a safe solution instead of throwing exceptions in error case wouldn't hurt too. (In addition to correct extension dependencies)
Stefan, I am not convinced that we should add code to actually hide a deployment problem. By now it's only chrome, in the future it may be other stuff that's missing then.
However, if we couldn't define a dependency (what seems to be the case for Sunbird), then it's of course better to show a proper dialog and disable/close the application.
It's even getting a bit more complicated, because we must only allow upgrades of calendar-timezones.xpi: Storage.sdb's calendar data will be updated to the latest timezones (bug 413908) in the future. A downgrade of calendar-timezones could potentially pose dataloss, because timezones once known are unknown then.
Flags: wanted-calendar0.9+
Flags: wanted-calendar0.9+ → wanted-calendar1.0+
The same error could happen if the extension is enabled but there is an error in the localization as experienced before. For example some errors like incorrect line breaks or encoding issues were not detected in the past because compare-locales works different than the stringbundle service.

This patch improves the situation by reporting the exact error and timezone that fails and displaying the raw timezone name instead of an empty string. This bug and the patch does not target issues like extension dependencies or extension upgrade behavior.
Attachment #349582 - Flags: review?(daniel.boelzle)
Attachment #349582 - Flags: review?(daniel.boelzle) → review+
Comment on attachment 349582 [details] [diff] [review]
[checked in] improve error reporting

>     get displayName calIntrinsicTimezone_get_displayName() {
...
>             } catch (exc) {
>-                ASSERT(false, exc);
>-                this.mDisplayName = null;
>+                Components.utils.reportError("Failed to get display name for timezone '" + this.tzid + "'. \n" + exc);

I've been thinking about reporting this as an error again, and think it's better to just log the error, because we might not have options for a complete l10n cycle each time we update the timezones.xpi, and thus have unlocalized strings. We don't want to bug users with (presumably) a few strings over and over again.

>+                this.mDisplayName = this.tzid;

You need to document this in the IDL file.


I've fixed this problem in a similarly already as part of bug 406579, attachment 348561 [details] [diff] [review] and will take those hunks.

r=dbo anyway
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/3c516d1c1248>

I am yet not convinced that this fixes the inherent problem. For now it's just resources (sqlite, jar), but it may be code in the future that could be disabled. Maybe listening for addon changes and preventing those is better.
Status: NEW → ASSIGNED
Target Milestone: --- → 1.0
Assignee: nobody → daniel.boelzle
Assignee: daniel.boelzle → nobody
Status: ASSIGNED → NEW
Attachment #349582 - Attachment description: improve error reporting → [checked in] improve error reporting
We are concentrating on Lightning, where the tz files are bundled, so we have no issues when the tz extension is missing. If someone wants to revive Sunbird, I think the tz files should be bundled there too. Closing this bug for now.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: