`retrieveItems` should be blocked when `retrieveItems` is already running
Issue #45
open
STR:
- Make sure pocket contains 2000+ items.
- Use a new profile.
- Open the popup, login to pocket, and close the popup.
- Observe the network debugger.
- While still fetching items, open the popup again.
- You should see duplicate requests with the same offset.
I think retrieveAll
is called multiple times.
https://bitbucket.org/pabuisson/in-my-pocket/src/8baed90156b0ed1d09cfa3c93a607343b8120ddf/src/background/background.js#lines-24
Comments (5)
-
repo owner -
repo owner - changed status to open
-
it might have something to do with chunking I implemented
-
reporter Does this happen only when pocket list contains more than 2k items?
It also happens with 2k- items but it is not that bad when there are few items.
I have 20k items. The extension has to make 11 requests to the server to fetch all items. With this bug, the extension will make 33 requests to the server if I open and close the popup twice. Also, the storage may end up with duplicate items.
-
I just submitted a fix for this
- Log in to comment
Good point indeed. Does this happen only when pocket list contains more than 2k items? On top of my head, I don’t know why it would only happen then, but I’ll need to check into the code, it’s been a long time.