-
Notifications
You must be signed in to change notification settings - Fork 970
fix "Cannot read property 'size' of undefined" error when getting persistent state #7467
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big ++ from me; I should have put that check in
…sistent state When upgrading from 0.13.4 to 0.13.5, this was causing getting persistent state to fail on startup, thereby losing session state. Fix #7466 Test Plan: 1. copy your session-store-1 from Brave 0.13.4 into the brave-development profile folder 2. npm start 3. Brave should show tabs, bookmarks, settings, etc from the 0.13.4 profile
@@ -483,6 +483,10 @@ describe('tabState unit tests', function () { | |||
const expectedAppState = defaultAppState.set('tabs', tabsWithoutField) | |||
assert.deepEqual(newAppState, expectedAppState) | |||
}) | |||
it('returns the state (unchanged) if tabs is falsey', function () { | |||
const newAppState = tabState.removeTabField(defaultAppState, 'loginRequiredDetail') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that you would want defaultAppState without the tabs
field for this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed- that variable exists in other files (with other states- whoops!). Thanks for catching 😄
Auditors: @diracdeltas Test Plan: `npm run unittest -- --grep='returns the state \(unchanged\) if tabs is falsey'`
Test plan
run
npm run unittest -- --grep='returns the state \(unchanged\) if tabs is falsey'
Description
When upgrading from 0.13.4 to 0.13.5, this was causing getting persistent state
to fail on startup, thereby losing session state. Fix #7466
Test Plan:
git rebase -i
to squash commits (if needed).