cxw42 / TabFern

Google Chrome extension for saving and restoring sets of tabs, and for switching between windows and tabs from a vertical, grouped list.
https://cxw42.github.io/TabFern/
Other
169 stars 27 forks source link

Syntax error in onTabReplaced() #304

Closed Procyon-b closed 1 year ago

Procyon-b commented 1 year ago

Item 1

In the final code, line 37839 of main.js, in the function onTabReplaced()

const errmsg = M.react_onTabReplaced(addedTabID, removedTabId);

addedTabID is undefined. It should be addedTabId

Item 2

I'm running 2 instances of TF and the fixed version works correctly, but then I also see an error once on line 37847 where it tells me that tab_val is undefined. I've fixed it temporarily with a try-catch.

cxw42 commented 1 year ago

Thanks for reporting! Would you please try branch issue304 @ 5f62e0a and confirm the issue is resolved? I don't have a good repro for onTabReplaced handy :) . Much appreciated!

Procyon-b commented 1 year ago

I'm now running 0.3.1.1 in parallel. I'll know if it works properly in a few hours.

Edit: One of the computers I'm using has only 2G of ram. It's not a problem with the old win7. And with ublock running in my browsers the webpages are much lighter. So the browser is still perfectly functionnal. It starts swapping when I reach 15-20 tabs (or less if they are big pages).

Procyon-b commented 1 year ago

The fix works. I don't have orphaned tabs left in TF list. But there is still the second error. I've launched chrome with TF 0.3.0 and 0.3.1.1 and looked at the dev tools. Then I opened as many sites as needed to trigger a tabReplace. What I could see is that for every error in 0.3.0 I can see an error in 0.3.1.1

in 0.3.0

Error in event handler: ReferenceError: addedTabID is not defined
    at onTabReplaced (chrome-extension://oflhofndbpjhlfnkbclmfkchpnkghflg/win/main.js:37839:42)

in 0.3.1.1:

Error in event handler: ReferenceError: tab_val is not defined
    at onTabReplaced (chrome-extension://oflhofndbpjhlfnkbclmfkchpnkghflg/win/main.js:37844:75)
cxw42 commented 1 year ago

Sorry --- missed that second item (now marked "Item 2") when I read your initial report! Fixed in force-pushed issue304, now 0.3.1.2. Please let me know if the issue is fixed at 98e8924. I tested the changes by manually invoking the onTabReplaced() function and it at least runs to completion :) . Thanks!

Procyon-b commented 1 year ago

I can confirm. Comparing side by side: No more errors. No orphaned tabs in the list. Looks good. :)

cxw42 commented 1 year ago

@Procyon-b Much appreciated! Will release shortly.

cxw42 commented 1 year ago

0.3.1 submitted for Google review --- will tag when it is released.

Procyon-b commented 1 year ago

It's released. :)