novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
34.02k stars 3.47k forks source link

🐛 Bug Report: step conditions not working with push webhook provider #5548

Open jainpawan21 opened 3 months ago

jainpawan21 commented 3 months ago

📜 Description

Novu supports adding multiple integrations of same provider. Each integration can have step conditions on tenants and based on these conditions, these providers can be used in workflow execution.

👟 Reproduction steps

  1. Create two push webhook integrations, give different webhook URL and secret hmac key. Give different names to each one to make it easy to identify later. Make these two integrations active
  2. Create a subscriber push-webhook-subscriber for testing this bug
  3. Update the above subscriber's credentials using this API for both of the integrations. Use any string value for device token
  4. Create a workflow with only push step. write title and message content.
  5. make sure only above two push webhook integrations are active for push channel providers
  6. Create two tenants with different name and identifier. Store this data
    
    // for first tenant
    {
    "country": "US"
    }

// for second tenant { "country": "EU" }



7. Add conditions on tenants for data.country key on both integrations
<img width="1031" alt="Screenshot 2024-05-12 at 3 25 10 PM" src="https://github.com/novuhq/novu/assets/39362422/01139041-6a60-4759-b297-2255cf74662b">
<img width="1031" alt="Screenshot 2024-05-12 at 3 25 25 PM" src="https://github.com/novuhq/novu/assets/39362422/e8bce1bc-7cb3-4739-aef6-6b3692becd86">

8. Trigger the workflow to `push-webhook-subscriber` subscriber and send tenant identifier also
9. Push step will be executed for both providers and conditions will not take effect

### 👍 Expected behavior

tenants conditions should take effect and integration should be disabled based on conditions 

### 👎 Actual Behavior with Screenshots

Tenants conditions are not working
<img width="1251" alt="Screenshot 2024-05-12 at 3 30 12 PM" src="https://github.com/novuhq/novu/assets/39362422/ed00da79-f331-441c-8ebd-ef3f4b53e98f">

### Novu version

Novu SaaS

### npm version

_No response_

### node version

_No response_

### 📃 Provide any additional context for the Bug.
transactionId: - `b67f3197-f0b5-4ea5-9603-f82d332cc3c1`

### 👀 Have you spent some time to check if this bug has been raised before?

- [X] I checked and didn't find a similar issue

### 🏢 Have you read the Contributing Guidelines?

- [X] I have read the [Contributing Guidelines](https://github.com/novuhq/novu/blob/main/CONTRIBUTING.md)

### Are you willing to submit PR?

None
linear[bot] commented 3 months ago

NV-3785 🐛 Bug Report: step conditions not working with push webhook provider