Closed
Bug 979262
Opened 10 years ago
Closed 10 years ago
Store large integer values as strings (you cannot set the XXX pref to the number YYY, as number pref values must be in the signed 32-bit integer range -(2^31-1) to 2^31-1)
Categories
(Calendar :: Internal Components, defect, P1)
Calendar
Internal Components
Tracking
(Not tracked)
RESOLVED
FIXED
3.2
People
(Reporter: aryx, Assigned: Fallen)
Details
Attachments
(1 file, 1 obsolete file)
6.34 KB,
patch
|
Fallen
:
review+
|
Details | Diff | Splinter Review |
With the latest sources, I saw the following error message when running mozmill tests: TEST-START | c:\Mozilla\Coding\Code\comm-central\objdir-thunderbird-central\mozilla\_tests\mozmill\stage\testLocalICS.js | testLocalICS ... setFieldValue: aElement.removeAttribute couldn't remove disabled from null e: TypeError: aElement is null ... Error: [calICSCalendar] Backup failed, no calendarmanager:[Exception... "you cannot set the calendar.registry.63cd6ba6-89a2-4d79-bfdd-f703b0b9549a.uniquenum pref to the number 1393937451510, as number pref values must be in the signed 32-bit integer range -(2^31-1) to 2^31-1. To store numbers outside that range, store them as strings.'you cannot set the calendar.registry.63cd6ba6-89a2-4d79-bfdd-f703b0b9549a.uniquenum pref to the number 1393937451510, as number pref values must be in the signed 32-bit integer range -(2^31-1) to 2^31-1. To store numbers outside that range, store them as strings.' when calling method: [calICalendarManager::setCalendarPref_]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: resource://calendar/modules/calProviderUtils.jsm :: cPB_setProperty :: line 796" data: no] Seems like the switch to Preferences.jsm (bug 923026) uncovered this type of issue.
Assignee | ||
Comment 1•10 years ago
|
||
As noted on IRC, this problem seems to have been there all along, but made visible with Preferences.jsm. We have a few other calendar properties that use date values. Possible solutions: * A wrapper around Preferences.jsm that saves larger integers as a tagged string pref and (de)serializes correctly (con: yet another wrapper function) * The same, but only in the setProperty part of the calendar manager that saves the prefs (con: might be more places this could fail) Archaeopteryx, do you want to create the patch for this?
Severity: normal → major
Assignee | ||
Updated•10 years ago
|
Priority: -- → P2
Assignee | ||
Comment 2•10 years ago
|
||
This should take care. I've decided not to migrate the preferences from the ics provider, since they will be recreated if unset anwyay.
Assignee: nobody → philipp
Status: NEW → ASSIGNED
Attachment #8389369 -
Flags: review?(archaeopteryx)
Assignee | ||
Updated•10 years ago
|
Priority: P2 → P1
Reporter | ||
Comment 3•10 years ago
|
||
Comment on attachment 8389369 [details] [diff] [review] Fix - v1 Review of attachment 8389369 [details] [diff] [review]: ----------------------------------------------------------------- ::: calendar/base/src/calCalendarManager.js @@ +752,5 @@ > cal.ASSERT(name && name.length > 0, "Pref Name must be non-empty!"); > > let branch = (getPrefBranchFor(calendar.id) + name); > + > + if (typeof value == "number" && (value > MAX_INT || value < MIN_INT || value % 1 != 0)) { You could use for the latter part: !Number.isInteger(value) I know it's longer, but boolean.
Attachment #8389369 -
Flags: review?(archaeopteryx) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Tree is closed, here is the patch for checkin.
Attachment #8389369 -
Attachment is obsolete: true
Attachment #8391953 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 5•10 years ago
|
||
https://hg.mozilla.org/comm-central/rev/92a0bdf9c37f
Updated•10 years ago
|
Target Milestone: --- → 3.2
You need to log in
before you can comment on or make changes to this bug.
Description
•