benjaffe / chrome-okc-plugin

OkCupid Poly Plugin
MIT License
63 stars 32 forks source link

Multiple Tabs Breaks Loading #115

Open AstraLuma opened 9 years ago

AstraLuma commented 9 years ago

If you open multiple profiles at once (eg, Control-Click), the plugin will partially load, but I can't set any categories in at least some (most likely any) of the loaded pages.

A refresh clears the issue.

benjaffe commented 9 years ago

I tried to reproduce this issue:

I tried Cmd-clicking to open several profiles in new tabs, then changing categories on one of the pages. That page refreshed, and the other pages didn't display the new category selection, but they did after a refresh. (When setting the new categories, an alert box says that you'll have to manually refresh the other pages).

If that's the issue, it's by design to simplify the code base since I had limited time to work on it. If I'm not describing the issue that you're seeing, feel free to reopen and clarify.

AstraLuma commented 9 years ago

Nope, wouldn't accept clicks at all for me.

AstraLuma commented 9 years ago

Console log:

chrome-extension://cgdblghohnaeeejaoincmbcdkdnodkei/lib/knockout/build/output/knockout-latest.js:5 Uncaught Error: Unable to parse bindings.
Message: TypeError: Cannot read property 'ip' of undefined;
Bindings value: click: toggleIsPoly, css: { checked: profileListData()['lion2294'] ? profileList()['lion2294'].ip == true : false}
chrome-extension://cgdblghohnaeeejaoincmbcdkdnodkei/ViewModels.js:202 toggleIsPoly run
chrome-extension://cgdblghohnaeeejaoincmbcdkdnodkei/ViewModels.js:203 Uncaught TypeError: Cannot read property 'ip' of undefined
chrome-extension://cgdblghohnaeeejaoincmbcdkdnodkei/ViewModels.js:202 toggleIsPoly run
chrome-extension://cgdblghohnaeeejaoincmbcdkdnodkei/ViewModels.js:203 Uncaught TypeError: Cannot read property 'ip' of undefined
chrome-extension://cgdblghohnaeeejaoincmbcdkdnodkei/ViewModels.js:202 toggleIsPoly run
chrome-extension://cgdblghohnaeeejaoincmbcdkdnodkei/ViewModels.js:203 Uncaught TypeError: Cannot read property 'ip' of undefined
AstraLuma commented 9 years ago

I should be clear. I'm just trying to label a user eg "Poly", "Not Poly". I'm not changing settings.

benjaffe commented 9 years ago

Ah, that changes things a lot!

benjaffe commented 9 years ago

Does this issue manifest on multiple profiles? In other words, could it be an issue with the users profile name having special characters?

Edit: I can't reproduce this issue with the profile listed in the error log. :/ It's possible there's some bad data that the plugin stored in your browser. Do you have another computer that you can test on? Or, you could make a new user account or open an incognito browser window and test it there to see if the issue persists.

AstraLuma commented 9 years ago

No particular profile. I've run into it a lot.

Based on the log, is it from a race condition where the page is partially loaded and then the plugin runs?