Closed Bug 1514699 Opened 6 years ago Closed 6 years ago

A promise chain failed to handle a rejection: Invalid window ID: -1 - stack: Async*background@moz-extension://81314c46-43c3-4aca-872a-491efdfb2ab0/%7B58bcc1b6-b067-47b4-8ba2-018dfb491e7b%7D.js:50:7 after bug 1498775 or bug 1514699

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1514673

People

(Reporter: arai, Unassigned)

References

Details

After fixing bug 1498775, the following error happens: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6ae720e277c240352adf7670c048743c768ae149&selectedJob=217387043 TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/test-oop-extensions/browser_ext_tabs_events.js | A promise chain failed to handle a rejection: Invalid window ID: -1 - stack: Async*background@moz-extension://81314c46-43c3-4aca-872a-491efdfb2ab0/%7B58bcc1b6-b067-47b4-8ba2-018dfb491e7b%7D.js:50:7 @moz-extension://81314c46-43c3-4aca-872a-491efdfb2ab0/%7B58bcc1b6-b067-47b4-8ba2-018dfb491e7b%7D.js:1:11 looks like the error happens inside `tabs` getter here: https://searchfox.org/mozilla-central/rev/1a4a7745fd4a14402a0de0e9abc040724d4fcf8f/browser/components/extensions/test/browser/head.js#592 > function background(expectIncognito) { > ... > let tabEvents = ["onUpdated", "onCreated", "onAttached", "onDetached", > "onRemoved", "onMoved", "onZoomChange", > "onHighlighted"]; > for (let eventName of tabEvents) { > browser.tabs[eventName].addListener(async details => { await testTabInfo(details, eventName); }); > } and the error is thrown here: https://searchfox.org/mozilla-central/rev/1a4a7745fd4a14402a0de0e9abc040724d4fcf8f/toolkit/components/extensions/parent/ext-tabs-base.js#1493 > class WindowTrackerBase extends EventEmitter { > getWindow(id, context, strict = true) { > if (id === WINDOW_ID_CURRENT) { > return this.getCurrentWindow(context); > } > > let window = Services.wm.getOuterWindowWithId(id); > if (window && !window.closed && (window.document.readyState !== "complete" > || this.isBrowserWindow(window))) { > if (!context || context.canAccessWindow(window)) { > // Tolerate incomplete windows because isBrowserWindow is only reliable > // once the window is fully loaded. > return window; > } > } > > if (strict) { > throw new ExtensionError(`Invalid window ID: ${id}`);
(In reply to Tooru Fujisawa [:arai] from comment #0) > looks like the error happens inside `tabs` getter here: > > https://searchfox.org/mozilla-central/rev/ > 1a4a7745fd4a14402a0de0e9abc040724d4fcf8f/browser/components/extensions/test/ > browser/head.js#592 > > function background(expectIncognito) { > > ... > > let tabEvents = ["onUpdated", "onCreated", "onAttached", "onDetached", > > "onRemoved", "onMoved", "onZoomChange", > > "onHighlighted"]; > > for (let eventName of tabEvents) { > > browser.tabs[eventName].addListener(async details => { await testTabInfo(details, eventName); }); > > } this seems to be wrong. the rejection points "browser" global variable access, but apparently this is unrelated to the error itself. will check the bug 1498775 patch.
this might be unrelated to bug 1498775, but bug 1514673
Summary: A promise chain failed to handle a rejection: Invalid window ID: -1 - stack: Async*background@moz-extension://81314c46-43c3-4aca-872a-491efdfb2ab0/%7B58bcc1b6-b067-47b4-8ba2-018dfb491e7b%7D.js:50:7 after bug 1498775 → A promise chain failed to handle a rejection: Invalid window ID: -1 - stack: Async*background@moz-extension://81314c46-43c3-4aca-872a-491efdfb2ab0/%7B58bcc1b6-b067-47b4-8ba2-018dfb491e7b%7D.js:50:7 after bug 1498775 or bug 1514699
clearly this is from bug 1514673
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.