Closed
      
        Bug 1450371
      
      
        Opened 7 years ago
          Closed 5 years ago
      
        
    
  
browser.tabs.Tab with { discarded: true, state: 'loading', }  
    Categories
(Firefox :: Tabbed Browser, defect, P3)
Tracking
()
        RESOLVED
        DUPLICATE
          of bug 1630167
        
    
  
People
(Reporter: n.gollenstede, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Build ID: 20180322152034
Steps to reproduce:
When using the `browser.tabs.discard` WebExtension API, it is possible that tabs end up in a state `{ discarded: true, state: 'loading', }`.
Besides being semantically incorrect (discarded tabs aren't loading), this also causes the tab load indicator to keep rotating (or whatever movement it does now).
The tab stays in that state until it is undated in some way.
This only happens sporadically when closing tabs with the attached extension, which I am currently porting, installed.
The extension detects the tab close and activates a loaded tab to be focused next, to avoid loading discarede (or not restored) tabs.
Due to the asynchronicity of the `browser.tabs` API, this may sometimes/often happens too late and a discarded tab is loaded. The extension will then rapid-fire `tabs.discard` and `tabs.unpdate( , { active: true, })` calls to stop the loading.
I will attach a sequence of actions and log messages that ended up with a `{ discarded: true, state: 'loading', }` tab in the next comment.
Actual results:
`browser.tabs.discard` leaves the tab in a state `{ discarded: true, state: 'loading', }`.
Expected results:
I think the tabs `status` should be `'complete'` for `discarded` tabs.
Or `'discarded'`, but that would probably be backwards-incompatible.
| Reporter | ||
| Comment 1•7 years ago
           | ||
The sequence of steps taken should be clear from the console output:
- tabs [1..6] were open (some not restored, some already unloaded)
- tab 7 was opened
- tab 5 was closed
- tab 7 was closed
| Reporter | ||
| Comment 2•7 years ago
           | ||
| Updated•7 years ago
           | 
Component: Untriaged → WebExtensions: Frontend
OS: Unspecified → All
Product: Firefox → Toolkit
Hardware: Unspecified → All
|   | ||
| Updated•7 years ago
           | 
Component: WebExtensions: Frontend → Tabbed Browser
Product: Toolkit → Firefox
| Comment 3•7 years ago
           | ||
Should probably be state: 'complete' as OP mentioned, but at the very least we should ensure that discarding tabs removes the tab throbber.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Blocks: tab-unloading
| Comment 4•5 years ago
           | ||
A quick note: I've noticed this when I enabled automatic tab unloading and it's a bit distracting when it happens. We plan on re-enabling automatic tab unloading in Firefox 72 so it might be nice to have this fixed soon(ish).
| Updated•5 years ago
           | 
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
          You need to log in
          before you can comment on or make changes to this bug.
        
 console-output-1.png
 console-output-1.png
            
Description
•