ArjixWasTaken / Nyaa-Utility

An extension that adds features to nyaa
https://chrome.google.com/webstore/detail/nyaa-utility/ebkeahhgiefhkcehhmdnlgaaakdbmlad
MIT License
13 stars 2 forks source link

Subscribing to threads is unreliable when multiple tabs are open #7

Closed motbob closed 3 years ago

motbob commented 3 years ago

Firefox, 1.5

Over the last week, I tried to subscribe to a bunch of comment threads like so:

This never resulted in logging the subscriptions that I was trying to do. I think this method only subscribes to the last tab in the series, but I could be wrong.

Today, I tried navigating to the thread I wanted to subscribe to, subscribing, and hitting the back button, without opening a new tab. That worked consistently.

ArjixWasTaken commented 3 years ago

~~Hmm, did you close the tabs too fast? It's made to refresh the page when it actually saves correctly.~~ Oh, I get why it happened. Will fix.

ArjixWasTaken commented 3 years ago

Ok, uhh, can you load the extension from github?

  1. Clone the repository to a folder.
  2. Follow the steps in the guide here
motbob commented 3 years ago

Ok, uhh, can you load the extension from github?

1. Clone the repository to a folder.

2. Follow the steps in the guide [here](https://riptutorial.com/firefox-addon/example/26613/installing-a-temporary-add-on)

I disabled the old add-on and then followed the instructions. It said it was version 1.6 on the help page, so I think I loaded the add-on correctly. However, the issue was not fixed. I tried the "multiple tabs" method and only ended up subscribed to the thread in the last tab.

ArjixWasTaken commented 3 years ago

Ok, uhh, can you load the extension from github?

1. Clone the repository to a folder.

2. Follow the steps in the guide [here](https://riptutorial.com/firefox-addon/example/26613/installing-a-temporary-add-on)

I disabled the old add-on and then followed the instructions. It said it was version 1.6 on the help page, so I think I loaded the add-on correctly. However, the issue was not fixed. I tried the "multiple tabs" method and only ended up subscribed to the thread in the last tab.

Hmm... Did the page refresh on its own before you closed the tab?

motbob commented 3 years ago

Ok, uhh, can you load the extension from github?

1. Clone the repository to a folder.

2. Follow the steps in the guide [here](https://riptutorial.com/firefox-addon/example/26613/installing-a-temporary-add-on)

I disabled the old add-on and then followed the instructions. It said it was version 1.6 on the help page, so I think I loaded the add-on correctly. However, the issue was not fixed. I tried the "multiple tabs" method and only ended up subscribed to the thread in the last tab.

Hmm... Did the page refresh on its own before you closed the tab?

Yes, the page always refreshes quickly.

ArjixWasTaken commented 3 years ago

Ok, uhh, can you load the extension from github?

1. Clone the repository to a folder.

2. Follow the steps in the guide [here](https://riptutorial.com/firefox-addon/example/26613/installing-a-temporary-add-on)

I disabled the old add-on and then followed the instructions. It said it was version 1.6 on the help page, so I think I loaded the add-on correctly. However, the issue was not fixed. I tried the "multiple tabs" method and only ended up subscribed to the thread in the last tab.

Hmm... Did the page refresh on its own before you closed the tab?

Yes, the page always refreshes quickly.

Welp, I guess I can't do anything about it then. Currently I use the browser api to store settings. And that is not so reliable if you modify settings too fast it seems. (it is asynchronous)

Just slow down, wait for like 2 seconds before following another torrent.

If you open the developer tools you will see that I print the current settings to the config subscribedThreads contains the followed torrents image in the above image I follow 1 torrent

ArjixWasTaken commented 3 years ago

Oh, since you use "threads" in the issue's title I guess you knew about the console message?

motbob commented 3 years ago

I did more tests, and this doesn't have anything to do with subscribing too fast.

The issue is that subscribing to subsequent tabs erases the previous subscriptions for whatever reason.

ArjixWasTaken commented 3 years ago

Oh, I get why. It's because the data get's overwritten. If you refresh the 2nd tab before subscribing it should work fine. I can fix that.

ArjixWasTaken commented 3 years ago

Retry now with the latest data.

ArjixWasTaken commented 3 years ago

Ok I promise this is the last time, finally fixed it

ArjixWasTaken commented 3 years ago

Uhh...it semi works i guess

ArjixWasTaken commented 3 years ago

;-;

motbob commented 3 years ago

Appears to work now. I'm having no problems in Firefox.

ArjixWasTaken commented 3 years ago

welp its not entirely fixed (if you try hard enough it will do the same thing as before), but I really can't improve it more than this. (unsubscribing on a previous tab removes any new subscription)

ArjixWasTaken commented 3 years ago

Let's leave it at that.

ArjixWasTaken commented 2 years ago

(This is completely fixed in the rewrite)

But the rewrite is still a W.I.P. so don't use it.