Closed
Bug 1148798
Opened 10 years ago
Closed 10 years ago
nsSuiteGlue.js error NS_ERROR_UNEXPECTED when running tests because "app.update.lastUpdateTime.background-update-timer" isn't set
Categories
(SeaMonkey :: General, defect)
SeaMonkey
General
Tracking
(seamonkey2.37 fixed)
RESOLVED
FIXED
seamonkey2.37
Tracking | Status | |
---|---|---|
seamonkey2.37 | --- | fixed |
People
(Reporter: philip.chee, Assigned: philip.chee)
Details
Attachments
(1 file, 1 obsolete file)
1.51 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
While working on Bug 1139958 I kept getting this error:
> JavaScript error: file:///c:/t1/hg/objdir-sm/dist/bin/components/nsSuiteGlue.js, line 669: NS_ERROR_UNEXPECTED
> : Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getIntPref]
Because "app.update.lastUpdateTime.background-update-timer" isn't set in the mochitest environment.
![]() |
Assignee | |
Comment 1•10 years ago
|
||
Test with prefHasUserValue() first
Comment 2•10 years ago
|
||
Comment on attachment 8585066 [details] [diff] [review]
Patch v1.0 Proposed fix
> // If there was an automated update tried in the interval, don't worry.
>- var lastUpdateTime = Services.prefs.getIntPref("app.update.lastUpdateTime.background-update-timer");
>+ const LASTUPDATETIME = "app.update.lastUpdateTime.background-update-timer";
>+ var lastUpdateTime = Services.prefs.prefHasUserValue(LASTUPDATETIME) ?
>+ Services.prefs.getIntPref(LASTUPDATETIME) : now;
> if (lastUpdateTime + maxAge > now)
> return false;
Please use the same constant for the pref as everyone else.
I'm not convinced that defaulting to now is correct, as if the preference doesn't exist that means that we haven't checked in the last three months.
It might be simpler to provide a default value in preferences (other consumers use 0 for unknown).
Attachment #8585066 -
Flags: review?(neil) → review-
![]() |
Assignee | |
Comment 3•10 years ago
|
||
> Please use the same constant for the pref as everyone else.
Done.
> I'm not convinced that defaulting to now is correct, as if the preference
> doesn't exist that means that we haven't checked in the last three
> months.
> It might be simpler to provide a default value in preferences (other
> consumers use 0 for unknown).
Done.
Attachment #8585066 -
Attachment is obsolete: true
Attachment #8585722 -
Flags: review?(neil)
Updated•10 years ago
|
Attachment #8585722 -
Flags: review?(neil) → review+
![]() |
Assignee | |
Comment 4•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-seamonkey2.37:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.37
You need to log in
before you can comment on or make changes to this bug.
Description
•