Skip to content

πŸ› Bug Report: Triggering an event for multiple receivers fails when one of them is invalidΒ #6572

Open
@JonasDoe

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

  1. Create a topic named myExistingTopic and subscribe with a user to it.
  2. 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"
    }
}
  1. 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 about myTopic.

πŸ‘ 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?

Are you willing to submit PR?

None

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions