Closed
Bug 1073259
Opened 9 years ago
Closed 9 years ago
Make SettingsManager calls with invalid windows throw better errors
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: qdot, Assigned: gerard-majax)
References
Details
(Whiteboard: [systemsfe])
Attachments
(2 files, 3 obsolete files)
2.41 KB,
patch
|
gerard-majax
:
review+
|
Details | Diff | Splinter Review |
1.52 KB,
patch
|
gerard-majax
:
review+
|
Details | Diff | Splinter Review |
As of bug 900551 landing, if mozSettings.createLock() is called after inner-window-destroyed, an exception is thrown due to sendAsyncMessage (called from the SettingsLock constructor) needing a window. The prior version of createLock was always guaranteed to succeed (and many calls expect it to, since they're made in a chained way, i.e. mozSettings.createLock().get(whatever), so the current one should too. This should be fixable by moving the createLock message to be sent the first time SettingsLock.sendMessage is called. Then we can always pass back a lock, and fail all requests after if it has no window to send to.
Reporter | ||
Comment 1•9 years ago
|
||
Actually, there's a far more simple fix: If we don't have a window, just return. We already do this in _closeHelper, but it should happen in sendMessage. This will make chained calls to get/set fail catastrophically when something tries to create a DOMRequest, but that should possibly be handled by DOMRequestHelper.
Reporter | ||
Comment 2•9 years ago
|
||
Attachment #8495624 -
Flags: review?(fabrice)
Reporter | ||
Comment 3•9 years ago
|
||
Attachment #8495625 -
Flags: review?(bent.mozilla)
Reporter | ||
Updated•9 years ago
|
Attachment #8495625 -
Attachment description: Patch 1 (v1) - Print more descriptive errors when SettingsManager tries to make request with invalid window → Patch 2 (v1) - Print more descriptive errors when SettingsManager tries to make request with invalid window
Reporter | ||
Comment 4•9 years ago
|
||
These patches should make errors more obvious, but do not fix the fact that Settings queries can fail after inner-window-destroyed. Best we can do there is a message to gaia.
Reporter | ||
Updated•9 years ago
|
Summary: Calling CreateLock on Settings should never fail or throw an exception → Make SettingsManager calls with invalid windows throw better errors
Updated•9 years ago
|
Attachment #8495624 -
Flags: review?(fabrice) → review+
Comment on attachment 8495625 [details] [diff] [review] Patch 2 (v1) - Print more descriptive errors when SettingsManager tries to make request with invalid window Review of attachment 8495625 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/settings/SettingsManager.js @@ +111,5 @@ > + // before sending, otherwise just ignore. > + if (!this._settingsManager._window) { > + Cu.reportError("SettingsManager window died, cannot run settings transaction."); > + Cu.reportError("SettingsMessage: " + aMessageName); > + Cu.reportError("SettingsData: " + JSON.stringify(aData)); This should probably be just one long string rather than 3 callse to reportError().
Attachment #8495625 -
Flags: review?(bent.mozilla) → review+
Updated•9 years ago
|
Whiteboard: [systemsfe]
Assignee | ||
Comment 6•9 years ago
|
||
Yay ... attachment 8495625 [details] [diff] [review] may help in bug 1074379
Flags: needinfo?(jlorenzo)
Assignee | ||
Comment 7•9 years ago
|
||
Carrying r+ from :bent Can we land this ?
Assignee: kyle → lissyx+mozillians
Attachment #8495625 -
Attachment is obsolete: true
Attachment #8504146 -
Flags: review+
Flags: needinfo?(anygregor)
Comment 8•9 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #7) > Created attachment 8504146 [details] [diff] [review] > 0001-Bug-1073529-Print-more-descriptive-errors-when-Setti.patch > > Carrying r+ from :bent > > Can we land this ? Sure, go ahead!
Flags: needinfo?(anygregor)
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 9•9 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #6) The issue from bug 1074379 is still present with that patch :S
Flags: needinfo?(jlorenzo)
Comment 11•9 years ago
|
||
And do both patches need to land?
Assignee | ||
Comment 12•9 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #10) > Is there a Try run for this? https://tbpl.mozilla.org/?tree=Try&rev=f98b982e8afb https://tbpl.mozilla.org/?tree=Try&rev=513ebd39b774
Assignee | ||
Comment 13•9 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #11) > And do both patches need to land? I think so.
Assignee | ||
Comment 14•9 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #12) > (In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #10) > > Is there a Try run for this? > > https://tbpl.mozilla.org/?tree=Try&rev=f98b982e8afb > https://tbpl.mozilla.org/?tree=Try&rev=513ebd39b774 Ryan, those are finished, it's mostly green but you may want to have a look to make sure :)
Flags: needinfo?(ryanvm)
Comment 15•9 years ago
|
||
Looks good to me. Please fix the bug number in the commit messages and request checkin.
Flags: needinfo?(ryanvm)
Assignee | ||
Comment 16•9 years ago
|
||
Oh, I missed this, thanks for catching.
Assignee | ||
Comment 17•9 years ago
|
||
Assignee | ||
Comment 18•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Attachment #8495624 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8504146 -
Attachment is obsolete: true
Assignee | ||
Comment 19•9 years ago
|
||
Comment on attachment 8506872 [details] [diff] [review] Print more descriptive errors when SettingsManager tried to make request with invalid window r=bent Carrying r+ from :bent, fixing bug number in commit message.
Attachment #8506872 -
Flags: review+
Assignee | ||
Comment 20•9 years ago
|
||
Comment on attachment 8506873 [details] [diff] [review] Print more descriptive errors when DOMRequestHelper tries to create request with invalid window r=fabrice Carrying r+ from :fabrice, fixing bug number in commit message.
Attachment #8506873 -
Flags: review+
Assignee | ||
Comment 21•9 years ago
|
||
Everything should be good now, fixed the commit messages, thanks for catching this!
Flags: needinfo?(ryanvm)
Keywords: checkin-needed
Updated•9 years ago
|
Flags: needinfo?(ryanvm)
Comment 22•9 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/b73bb9d2c9e1 https://hg.mozilla.org/integration/b2g-inbound/rev/3bd9a78ed444
Keywords: checkin-needed
Comment 23•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b73bb9d2c9e1 https://hg.mozilla.org/mozilla-central/rev/3bd9a78ed444
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•