Closed Bug 1592634 Opened 5 years ago Closed 4 years ago

Awaiting browser.tabs.update(tab.id, {active: true}) won't wait for tab to get activated

Categories

(WebExtensions :: Android, defect, P3)

68 Branch
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1616625

People

(Reporter: juraj.masiar, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

  1. open Firefox for Android
  2. open any extension page
  3. debug that page from Desktop Firefox
  4. execute following code:
(async () => {
  const timeoutPromise = delay => new Promise(resolve => setTimeout(resolve, delay));
  const tab = await browser.tabs.create({url: 'https://wiki.mozilla.org/', active: false});
  await timeoutPromise(1000);
  await browser.tabs.update(tab.id, {active: true});
  while ((await browser.tabs.query({active: true, lastFocusedWindow: true}).then(([tab]) => tab)).id !== tab.id) {
    console.warn('still not active');
    await timeoutPromise(1);
  }
})();

Actual results:

Depending on the device performance, the code can finish without any logs OR it will print still not active.
In the real life extension, actual activation took almost 300ms after browser.tabs.update finished.

Expected results:

browser.tabs.update should be resolved only AFTER the tab is really activated.

The priority flag is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Depends on: 1543755
Flags: needinfo?(jmathies)
Priority: -- → P3
Blocks: 1543755
No longer depends on: 1543755

We fixed this in Bug 1616625.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.