react-native-offline icon indicating copy to clipboard operation
react-native-offline copied to clipboard

Actions from actionQueue are sometimes dispatched multiple times

Open juspeeh opened this issue 4 years ago • 3 comments

Current Behavior

  • What code are you running and what is happening?

Actions from actionQueue are sometimes dispatched multiple times

Expected Behavior

  • What do you expect should be happening?

Every action from actionQueue should be dispatched only once

How to reproduce

When "@@network-connectivity/CONNECTION_CHANGE" action queue to be flushed is created. If action inside that queue dispatches "@@network-connectivity/CHANGE_QUEUE_SEMAPHORE", payload "GREEN"( as the readME recommends if you want to wait an action to complete before the next action). Due to the action being intercepted by the library a secondary queue will be created and those both are ran simultaneously. Nothing is done to check if certain action is already removed from the actual state or queue is already being flushed. This causes X amount of actions to be dispatched multiple times depending on the queue size.

juspeeh avatar Dec 28 '21 10:12 juspeeh

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 02 '22 12:03 stale[bot]

facing same issue

queueReleaseThrottle was 2000, looks like using default 50 is solve problem, but there is still principal problem with waiting this throttle time in middleware.

superyarik avatar Apr 08 '22 11:04 superyarik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 13 '22 01:06 stale[bot]

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

stale[bot] avatar Aug 13 '22 14:08 stale[bot]