novu icon indicating copy to clipboard operation
novu copied to clipboard

[NV-1234] 🐛 Bug Report: "Mark a Subscriber Message as Seen" now returns an array instead of an object

Open markmssd opened this issue 1 year ago • 3 comments

📜 Description

The /subscribers/:subscriberId/messages/:messageId/seen used to return an object, as { data : message }, but it now returns an array as { data: [ message ] }. I've looked through the Novu 0.9.0 changelog and this doesn't seem intentional.

👟 Reproduction steps

Simply call the /subscribers/:subscriberId/messages/:messageId/seen endpoint, and inspect the response!

👍 Expected behavior

{
      "_id": "7424330252f89d6dc2bd8dd9",
      "_templateId": "54333bb0c26b68d4d067c9",
      "_environmentId": "8765c40853b9b0393a2aad1a",
      "_messageTemplateId": "8765ce3bb0c26b68d4d067c1",
      "_notificationId": "0987330252f89d6dc2bd8dc9",
      "_organizationId": "1234c40853b9b0393a2aad07",
      "_subscriberId": "7410a44f517e174e9008hg43",
      "templateIdentifier": "novu-invite-to-an-organization",
      "email": "[email protected]",
      "subject": "[Novu] You are invited to join a Novu organization",
      "cta": {
          "action": {
              "buttons": []
          }
      },
      "channel": "email",
      "content": [
          {
              "type": "text",
              "content": "<span>Hi, We are inviting you to join Organization Name</span>",
              "styles": {
                  "textAlign": "left"
              },
              "url": ""
          },
          {
              "type": "button",
              "content": "Test Notification",
              "styles": {
                  "textAlign": "left"
              },
              "url": "https://novu.url/auth/invitation/xxx"
          }
      ],
      "providerId": "sendgrid",
      "deviceTokens": [],
      "seen": false,
      "status": "sent",
      "transactionId": "kj3kfd3k3j-b4cc-4805-b3c5-62889a8583a4",
      "payload": {
          "email": "[email protected]",
          "inviteeName": "Invitee Name",
          "organizationName": "Organization Name",
          "inviterName": "Inviter Name",
          "acceptInviteUrl": "https://novu.url/auth/invitation/1234353-3599-11ed-b2b0-b5195a81006f"
      },
      "createdAt": "2022-09-16T08:25:38.844Z",
      "updatedAt": "2022-09-16T08:25:38.844Z",
      "__v": 0
}

👎 Actual Behavior with Screenshots

{
    "data": [
        {
            "_id": "7424330252f89d6dc2bd8dd9",
            "_templateId": "54333bb0c26b68d4d067c9",
            "_environmentId": "8765c40853b9b0393a2aad1a",
            "_messageTemplateId": "8765ce3bb0c26b68d4d067c1",
            "_notificationId": "0987330252f89d6dc2bd8dc9",
            "_organizationId": "1234c40853b9b0393a2aad07",
            "_subscriberId": "7410a44f517e174e9008hg43",
            "templateIdentifier": "novu-invite-to-an-organization",
            "email": "[email protected]",
            "subject": "[Novu] You are invited to join a Novu organization",
            "cta": {
                "action": {
                    "buttons": []
                }
            },
            "channel": "email",
            "content": [
                {
                    "type": "text",
                    "content": "<span>Hi, We are inviting you to join Organization Name</span>",
                    "styles": {
                        "textAlign": "left"
                    },
                    "url": ""
                },
                {
                    "type": "button",
                    "content": "Test Notification",
                    "styles": {
                        "textAlign": "left"
                    },
                    "url": "https://novu.url/auth/invitation/xxx"
                }
            ],
            "providerId": "sendgrid",
            "deviceTokens": [],
            "seen": false,
            "status": "sent",
            "transactionId": "kj3kfd3k3j-b4cc-4805-b3c5-62889a8583a4",
            "payload": {
                "email": "[email protected]",
                "inviteeName": "Invitee Name",
                "organizationName": "Organization Name",
                "inviterName": "Inviter Name",
                "acceptInviteUrl": "https://novu.url/auth/invitation/1234353-3599-11ed-b2b0-b5195a81006f"
            },
            "createdAt": "2022-09-16T08:25:38.844Z",
            "updatedAt": "2022-09-16T08:25:38.844Z",
            "__v": 0
        }
    ]
}

💻 Operating system

Linux

🤖 Node Version

16

📃 Provide any additional context for the Bug.

No response

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

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

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

No response

NV-1234

markmssd avatar Nov 22 '22 15:11 markmssd

@djabarovgeorge might be able to help here ^

scopsy avatar Nov 27 '22 11:11 scopsy

Hey @markmssd Thanks for bringing this up and creating the issue (a well detailed one I may say! 👍🏻 ) look like the response changed by mistake I will create PR in order to resolve it asap. sorry for the inconvenience.

djabarovgeorge avatar Nov 27 '22 14:11 djabarovgeorge

Awesome, thanks for the super quick fix @djabarovgeorge ! 🚀

markmssd avatar Nov 28 '22 14:11 markmssd