You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error shows clearly that the command simply missing the stream keys, which at that point don't exists.
Am I doing something wrong here?
If not I think this error can be avoided easily by checking if there's any subscribed events in before the next poll
Ill gladly open a PR for that.
Thanks
Code sample
import{PubSubRedisBroker}from"@discordjs/brokers";import{Redis}from"ioredis";constbroker=newPubSubRedisBroker({redisClient: newRedis()});awaitbroker.subscribe("channel",["event"]);broker.on("event",(message)=>{console.log(message);});broker.on("error",(error)=>{// This will be a ReplyError on the next pollconsole.error(error);});awaitbroker.publish("event","message");// This will make the BaseRedis subscribedEvents empty// But BaseRedis listen will continue to poll until errorsawaitbroker.unsubscribe("channel",["event"]);
Versions
"@discordjs/brokers": "^0.2.2"
Node 18
"ioredis": "^5.3.2"
Issue priority
Low (slightly annoying)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered:
If not I think this error can be avoided easily by checking if there's any subscribed events in before the next poll
yup. odd bug. can I ask what the use case here is? are you dynamically subscribing/unsubscribing to certain keys? I'd never see myself running into this personally
I'll PR a fix soon-ish, this also made me notice the destroy method should completely stop polling.
Sure, In my case I'm creating a stream per user, subscribing when a user connected via socket and unsubscribing on disconnect. so In this case when last user disconnects this error will occur.
Which package is this bug report for?
brokers
Issue description
Hey,
First of all, Thanks for this package!
I noticed that
PubSubRedisBroker
errors when it is trying to pull usingxreadgroup
without subscribed events.The error is a Redis
ReplyError
because the command is incomplete because it has no streams keys in itHeres the error:
The error shows clearly that the command simply missing the stream keys, which at that point don't exists.
Am I doing something wrong here?
If not I think this error can be avoided easily by checking if there's any subscribed events in before the next poll
Ill gladly open a PR for that.
Thanks
Code sample
Versions
Issue priority
Low (slightly annoying)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: