Browser-laptop: bad session state can result in permanently borked profile

Created on 22 Feb 2018  路  7Comments  路  Source: brave/browser-laptop

Description

I haven't reproduced yet, but I was following the test plans set out in https://github.com/brave/browser-laptop/pull/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.

0.22.x Qchecked-Linux Qchecked-Win64 Qchecked-macOS Qtest-plan-specified bug release-noteinclude

All 7 comments

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)

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 - 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?

@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.

@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.

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 #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

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

Verified on Ubuntu 16.04 using the following build:

Verified on Win 10 x64 using the following build:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antiroyalty picture antiroyalty  路  3Comments

luixxiul picture luixxiul  路  3Comments

jonathansampson picture jonathansampson  路  3Comments

bbondy picture bbondy  路  3Comments

mykkymk picture mykkymk  路  3Comments