`retrieveItems` should be blocked when `retrieveItems` is already running

Issue #45 open
零欸特 created an issue

STR:

  1. Make sure pocket contains 2000+ items.
  2. Use a new profile.
  3. Open the popup, login to pocket, and close the popup.
  4. Observe the network debugger.
  5. While still fetching items, open the popup again.
  6. 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)

  1. Pierre-Adrien Buisson repo owner

    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.

  2. 零欸特 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.

  3. Log in to comment