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

Missing Properties on Publisher Object Breaks Brave #13330

Closed
NejcZdovc opened this issue Feb 27, 2018 · 3 comments · Fixed by #13503
Closed

Missing Properties on Publisher Object Breaks Brave #13330

NejcZdovc opened this issue Feb 27, 2018 · 3 comments · Fixed by #13503

Comments

@NejcZdovc
Copy link
Contributor

NejcZdovc commented Feb 27, 2018

Test plan

(steps copied from #13488)

Corrupted state: session-store-1.zip

You can use the attached session store (above) OR manually modify the ledger.synopsis.publishers section of your session-store-1 to match the below (the first entry is corrupt and prevents Brave from loading properly).

{
    "ledger": {
        "synopsis": {
            "publishers": {
                "youtube#channel:UCdDpQ461uxNA3odAnpuigAg": {
                    "weight": 3,
                    "pinPercentage": 3,
                    "window": [
                        {
                            "timestamp": 1521228928558
                        }
                    ],
                    "options": {
                        "exclude": false
                    }
                },
                "youtube#channel:UCgFvT6pUq9HLOvKBYERzXSQ": {
                    "scores": {
                        "concave": 13.411161746224534,
                        "visits": 10
                    },
                    "visits": 1,
                    "window": [
                        {
                            "timestamp": 1520655903012,
                            "visits": 1,
                            "duration": 195578,
                            "scores": {
                                "concave": 13.411161746224534,
                                "visits": 10
                            }
                        }
                    ],
                    "publisherURL": "https://www.youtube.com/user/Davie504/videos",
                    "duration": 195578,
                    "faviconURL": "file://C:\\Users\\jjdsa\\AppData\\Roaming\\brave\\ledger-favicons\\youtube_channel_UCgFvT6pUq9HLOvKBYERzXSQ.jpeg",
                    "providerName": "YouTube",
                    "options": {
                        "exclude": true,
                        "verified": false,
                        "verifiedTimestamp": 6533268663129080000
                    },
                    "faviconName": "Davie504"
                }
            }
        }
    }
}

Description

An uncaught exception occurred in the main process Uncaught Exception:
TypeError: Cannot read property 'concave' of undefined
    at Synopsis.<anonymous> (E:\srirambv\browser-laptop\node_modules\bat-publisher\index.js:328:43)
    at Array.forEach (<anonymous>)
    at Synopsis._topN (E:\srirambv\browser-laptop\node_modules\bat-publisher\index.js:327:36)
    at Synopsis.topN (E:\srirambv\browser-laptop\node_modules\bat-publisher\index.js:299:15)
    at Object.run (E:\srirambv\browser-laptop\app\browser\api\ledger.js:2211:28)
    at ledgerReducer (E:\srirambv\browser-laptop\app\browser\reducers\ledgerReducer.js:286:19)
    at reducers.reduce (E:\srirambv\browser-laptop\js\stores\appStore.js:191:24)
    at Array.reduce (<anonymous>)
    at applyReducers (E:\srirambv\browser-laptop\js\stores\appStore.js:189:68)
    at handleAppAction (E:\srirambv\browser-laptop\js\stores\appStore.js:253:16)
    at callbacks.forEach (E:\srirambv\browser-laptop\js\dispatcher\appDispatcher.js:107:7)
    at Array.forEach (<anonymous>)
    at AppDispatcher.dispatchToOwnRegisteredCallbacks (E:\srirambv\browser-laptop\js\dispatcher\appDispatcher.js:106:20)
    at AppDispatcher.dispatchInternal (E:\srirambv\browser-laptop\js\dispatcher\appDispatcher.js:132:10)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)

Saw it only once

@NejcZdovc NejcZdovc added this to the 0.21.x (Beta Channel) milestone Feb 27, 2018
@NejcZdovc NejcZdovc self-assigned this Feb 27, 2018
@alexwykoff alexwykoff modified the milestones: 0.21.x (Beta Channel), 0.22.x (Developer Channel) Feb 27, 2018
@LaurenWags
Copy link
Member

LaurenWags commented Feb 27, 2018

+1 from me - just experienced this on 0.21.16 no STR though.

An uncaught exception occurred in the main process Uncaught Exception: TypeError: Cannot read property 'concave' of undefined at Synopsis.<anonymous> (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/node_modules/bat-publisher/index.js:328:43) at Array.forEach (<anonymous>) at Synopsis._topN (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/node_modules/bat-publisher/index.js:327:36) at Synopsis.topN (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/node_modules/bat-publisher/index.js:299:15) at run (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/app/browser/api/ledger.js:2209:28) at Object.onLedgerFirstSync (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/app/browser/api/ledger.js:2165:5) at ledgerReducer (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/app/browser/reducers/ledgerReducer.js:271:27) at handleAppAction (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/js/stores/appStore.js:249:16) at callbacks.forEach (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/js/dispatcher/appDispatcher.js:107:7) at Array.forEach (<anonymous>) at AppDispatcher.dispatchToOwnRegisteredCallbacks (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/js/dispatcher/appDispatcher.js:106:20) at AppDispatcher.dispatchInternal (/Users/laurenwagner/Brave Documents/Laptop/Brave Beta/Brave-Beta.app/Contents/Resources/app.asar/js/dispatcher/appDispatcher.js:132:10) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5)

@NejcZdovc
Copy link
Contributor Author

will be fixed with brave-intl/bat-publisher#23

NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Mar 1, 2018
Resolves brave#13330

Auditors:

Test Plan:
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Mar 15, 2018
Resolves brave#13330

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Mar 15, 2018
NejcZdovc added a commit that referenced this issue Mar 15, 2018
NejcZdovc added a commit that referenced this issue Mar 15, 2018
NejcZdovc added a commit that referenced this issue Mar 19, 2018
@NejcZdovc NejcZdovc modified the milestones: 0.22.x (Beta Channel), 0.21.x w/ Chromium 65 (Release Channel) Mar 19, 2018
@bsclifton bsclifton changed the title Null error in bat-publisher Missing Properties on Publisher Object Breaks Brave Mar 19, 2018
@bsclifton
Copy link
Member

+1 from @MoonRubles via #13474

Description

After a hard crash (UI completely unresponsive, restarted computer), there are NO tabs visible, and cannot add tabs. No address bar. Main menu is there, but Settings... doesnt open window. Lastpass window blank.

Note: can someone tell me what files to delete to remove the corruption? I was using Payments on this computer so I'd like not to lose all my funds.

Also: this occurred right about when payments should have happened, where Ive been having an issue #13156

Steps to Reproduce

  1. Wait for brave to lock up on its own. Happens every few days.
  2. If you are unlucky, when you start brave will be unusable as described above.
  3. Repeated restart does not change this.

Actual result:
braveblank

@NejcZdovc NejcZdovc reopened this Mar 19, 2018
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Mar 19, 2018
Resolves brave#13330

Auditors:

Test Plan:
@NejcZdovc NejcZdovc mentioned this issue Mar 19, 2018
10 tasks
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Mar 19, 2018
Resolves brave#13330

Auditors:

Test Plan:
bsclifton added a commit that referenced this issue Mar 19, 2018
bsclifton added a commit that referenced this issue Mar 19, 2018
bsclifton added a commit that referenced this issue Mar 19, 2018
bsclifton added a commit that referenced this issue Mar 19, 2018
@kjozwiak kjozwiak added the bug label Mar 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.