π Bug Report: Triggering an event for multiple receivers fails when one of them is invalidΒ #6572
Open
Description
π Description
Update: I've posted an updated and more precise description of the error in a comment below.
Old description:
I trigger an event with this payload:
{
"actor": "myTestActor",
"name": "generic-message",
"payload": {
"myTestData": "hello"
},
"to": [
{
"type": "Topic",
"topicKey": "myTopic"
},
{
"type": "Subscriber",
"subscriberId": "mySubscriber"
}
],
}
mySubscriber
will get a notification, subscribers to myTopic
won't. Removing the second to
entry won't help - the topic won't receive the event as long as to
has the form of a list.
π Reproduction steps
- Create a topic named
myExistingTopic
and subscribe with a user to it. - Run
curl --location 'https://api.notification.app.myCompany.cloud/v1/events/trigger' \
--header 'Authorization: ApiKey *******' \
--header 'Content-Type: application/json' \
--data '{
"actor": "myTestActor",
"name": "generic-message",
"payload": {
"myTestData": "hello"
},
"to": [
{
"type": "Topic",
"topicKey": "myTopic"
},
{
"type": "Subscriber",
"subscriberId": "mySubscriber"
}
],
}'
The response is 201
with
{
"data": {
"acknowledged": true,
"status": "processed",
"transactionId": "487f708e-4a37-4438-9ec8-87deb5510ee2"
}
}
- See that the subscribers for
myTopic
didn't receive any messge, while the subscriber did. Furthermore, in the Novu Center's Activity Feed you won't see anything aboutmyTopic
.
π Expected behavior
The users subscribed to myTopic
should receive a message about the triggered event.
π Actual Behavior with Screenshots
The users subscribed to myTopic
doesn't receive a message about the triggered event.
Novu version
0.24.0
npm version
I cannot provide this information right now, but we're basically using ghcr.io/novuhq/novu/api:0.24.0
node version
20.11.1
π Provide any additional context for the Bug.
It seems like triggering an event for a topic works when it's not in an array. So
{
...
"to": {
"type": "Topic",
"topicKey": "myTopic"
}
}
will work.
π Have you spent some time to check if this bug has been raised before?
- I checked and didn't find a similar issue
π’ Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to submit PR?
None