Skip to content

client tearDown() could result in race condition on listen loop.

There is a chance this code gets called even though the redis connection has already been severed.

https://gitlab.com/strata-js/strata/-/blob/master/src/engines/messageQueue.ts#L40

Because when calling the tearDown method on a strata client it is not correctly setting the following property to let the listenLoop know it has been disconnected.

https://gitlab.com/strata-js/strata/-/blob/master/src/utils/messageQueue.ts#L132