Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

bad session state can result in permanently borked profile #13261

Closed
LaurenWags opened this issue Feb 22, 2018 · 7 comments · Fixed by #13265
Closed

bad session state can result in permanently borked profile #13261

LaurenWags opened this issue Feb 22, 2018 · 7 comments · Fixed by #13265

Comments

@LaurenWags
Copy link
Member

LaurenWags commented Feb 22, 2018

Description

I haven't reproduced yet, but I was following the test plans set out in #11313 for the keyboard shortcuts. I close Brave and reopened near the end to see if my tab order was preserved and that's when I discovered that my profile is borked. I can't reload existing tabs, new windows are useless, my pinned tabs spin, I can't open new tabs.

Steps to Reproduce

I don't have exact steps yet, I was using a clean profile to follow the test cases in the PR referenced above. Generally this is what I did:

  1. Clean profile using 0.21.11
  2. Open several tabs with sites. Use keyboard shortcut ctrl+shift+pg up/down to move tabs around.
  3. Open a second window. Repeat step 2.
  4. In second window, pin some of the tabs. Open some new tabs with different sites.
  5. In second window, move pinned tabs around with keyboard shortcut.
  6. In second window, move normal (not pinned) tabs around with keyboard shortcut.
  7. Open prefs, change tab count to 6 per tab page.
  8. Close/Reopen Brave.

Another STR from #13339

(steps 2 and 3 don't seem required to reproduce, and can reproduce on 0.20)

  1. Clean install 0.21.17
  2. Launch browser with LEDGER_ENVIRONMENT=staging (not sure if this makes any difference but issue found when launched with this env variable
  3. Enable payments and add some funds
  4. Open a new tab and type a wrong URL ( i had typed http://epcohconverter.com)
  5. Console shows error
  6. Try entering correct URL, doesn't work
  7. Try opening a new tab, doesn't load a new tab
  8. Unable to close browser have to kill the app

Actual result:
Profile borked. Error in console shows:

Uncaught TypeError: Cannot read property 'filterNot' of undefined
at R (gen/app.entry.js:1)
at callbacks.forEach (gen/app.entry.js:1)
at Array.forEach ()
at Object.dispatchToOwnRegisteredCallbacks (gen/app.entry.js:1)
at Object.dispatchInternal (gen/app.entry.js:1)
at n.cargo (gen/app.entry.js:1)
at Object.process (gen/app.entry.js:1)
at gen/app.entry.js:1
at gen/app.entry.js:1
at gen/lib.devTools.js:1

Expected result:
Profile should not be borked

Reproduces how often:
Unknown

Brave Version

about:brave info:
0.21.11

Reproducible on current live release:
yes

Additional Information

I did this with a testing profile, I can provide it if it will be helpful.

@LaurenWags LaurenWags added the bug label Feb 22, 2018
@LaurenWags LaurenWags added this to the 0.21.x (Beta Channel) milestone Feb 22, 2018
@LaurenWags
Copy link
Member Author

This was displayed in the terminal:

[76516:775:0222/171501.726464:ERROR:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'filterNot' of undefined", source: chrome://brave/Users/laurenwagner/Brave%20Documents/Laptop/Brave%20Beta/Brave-Beta.app/Contents/Resources/app.asar/app/extensions/brave/gen/app.entry.js (1)
[76516:775:0222/171501.743616:ERROR:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'filterNot' of undefined", source: chrome://brave/Users/laurenwagner/Brave%20Documents/Laptop/Brave%20Beta/Brave-Beta.app/Contents/Resources/app.asar/app/extensions/brave/gen/app.entry.js (1)
[76516:775:0222/171501.814583:ERROR:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'filterNot' of undefined", source: chrome://brave/Users/laurenwagner/Brave%20Documents/Laptop/Brave%20Beta/Brave-Beta.app/Contents/Resources/app.asar/app/extensions/brave/gen/app.entry.js (1)

petemill added a commit that referenced this issue Feb 23, 2018
…o perWindowState[].closedFrames property, which would then cause the app never recover, even after restart.

Fix #13261, although since that's not reproducible I'm not sure the moving-tab keyboard shortcut neccessarily caused it, but something did, and this will allow recovery in that situation.
@petemill
Copy link
Member

I have made a fix in #13265 that addressed this unrecoverable 'borked' behavior. That will stop the console errors from being thrown, and allow the browser to function normally (tested with aforementioned borked profile). Since this is not reproducible, I'm not sure that the keyboard shortcut for moving tabs caused it. Having about:error pages in the profile may have something to do with it, as that's what makes the error get thrown, but something happened in the way the browser was exited, which caused the state file to be a bit 'weird' looking! So suggest we close this with that PR, and open something else if we find another STR with another symptom.

@petemill petemill self-assigned this Feb 23, 2018
@petemill petemill changed the title moving tabs (pinned and unpinned) via keyboard shortcuts borked profile bad session state can result in permanently borked profile Feb 27, 2018
@bsclifton bsclifton added the 0.22.x issue first seen in 0.22.x label Feb 27, 2018
bsclifton pushed a commit that referenced this issue Feb 28, 2018
…o perWindowState[].closedFrames property, which would then cause the app never recover, even after restart.

Fix #13261, although since that's not reproducible I'm not sure the moving-tab keyboard shortcut neccessarily caused it, but something did, and this will allow recovery in that situation.
@LaurenWags
Copy link
Member Author

@petemill - if I launch the borked profile with 0.21.24 it's definitely screwed up as I would expect and when I launch with 0.22.7 all my tabs seem to be restored and functional which is awesome. However, I also get two blank about:error tabs each time I launch the profile in 0.22.7 - no errors in terminal though. Is there somewhere else I can look for information?

@petemill
Copy link
Member

@LaurenWags I could reproduce that and now I can't. It looks like all the tabs in the profile (pinned and non-pinned) are opening fine, and those error tabs are additional, as far as I can see. So, not a huge issue if that's the case, but will keep trying to reproduce and find out what's opening them.

@petemill
Copy link
Member

petemill commented Mar 26, 2018

@LaurenWags and now I can reproduce it again when using the full 'borked' profile directory and not just the session-store. Perhaps something in the cache, will look for another minute.

Edit: seems like it's caused by the pinned Ebay tab failing to load with shields turned off. Not sure why shields is causing it not to load the first time, but ok the next time, and also why the error page is loading in a new tab instead of the ebay tab.

@petemill
Copy link
Member

petemill commented Mar 26, 2018

This has shown two issues:

  1. If loading a pinned tab errors, the error is not shown in the pinned tab, but is shown in a new tab which does not show the url which errors. The pinned tab then shows a non-branded error page. This can be a confusing UX as we've seen here, as it's not clear where the error tab has come from. Logged in Error loading pinned tab opens new tab with unclear error #13609 and fix incoming, though likely won't be prioritized into 0.22.
  2. This borked profile seems to have bad cookies which is preventing ebay loading. Clearing cookies fixes that issue. If we have a STR for that, let's open a new issue @LaurenWags

@LaurenWags
Copy link
Member Author

LaurenWags commented Mar 27, 2018

Confirmed clearing cookies resolves the issue in my borked profile. Looks good.
Verified on macOS 10.12.6 x64 using the following build:

  • 0.22.7 8bb7e77
  • libchromiumcontent: 65.0.3325.181
  • muon: 5.1.1

Verified on Ubuntu 16.04 using the following build:

  • 0.22.11 56de947
  • libchromiumcontent: 65.0.3325.181
  • muon: 5.1.2

Verified on Win 10 x64 using the following build:

  • 0.22.11 56de947
  • libchromiumcontent: 65.0.3325.181
  • muon: 5.1.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.