JamesValero / yjl

Automatically exported from code.google.com/p/yjl
0 stars 0 forks source link

[Keep Last Two Tabs] Many tabs opens when you close tabs by "close tabs to the right" #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open many tabs.
2. Right click on the leftmost tab and select "close tabs to the right".

What is the expected output? What do you see instead?
Opening one new tab is good enough.
As many tabs as ones that just closed open. Rarely, it is happens fewer tabs 
open.

What version of the product are you using?
Keep Last Two Tabs 0.3.1

Please provide any additional information below.
I made a patch for this issue.

Original issue reported on code.google.com by lacr...@gmail.com on 4 Dec 2011 at 7:45

Attachments:

GoogleCodeExporter commented 8 years ago
Sorry for late response.

After I tested it, it did have such issue. Here is my steps to reproduce

  1. Click New Tab buttons for at least 20 times. So you will have 20+ tabs.
  2. Right click on leftmost tab.
  3. Select Close Tabs to The Right, closing all tabs except the leftmost one.

You should see, some or even all tabs still in place.

The cause is the *Race Condition*.

The patch does fix the issue, it ensures only one tab is created by this 
extension, however there is another issue, the created tab is also closed by 
Chrome since it's at right to the leftmost tab. Therefore, once tabs are 
closed, there is only one tab left which is the leftmost one. If you continue 
to close the only left tab, Chrome quits.

I made some changes by adding a timer to check the situation. It should be sort 
of fieed in version 0.4 and it is available on Web Store.

By the way, this project has been moved to GitHub:

  https://github.com/livibetter/KLTT

Anymore inputs, please open a new issue on GitHub with additional information.

Original comment by livibet...@gmail.com on 17 Jan 2012 at 6:27