novuhq / novu

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

[NV-1726] 🐛 Bug Report: Unable to sort descending & filter unseen/seen for message list #2829

Open stefanlam88 opened 1 year ago

stefanlam88 commented 1 year ago

📜 Description

https://docs.novu.co/api/get-messages/

based on this API, unable to sort descending. User need to know latest push message. and cannot be filtered as seen/read. Now need manually filters

👟 Reproduction steps

  1. Create 2 or more notification
  2. Observe the notification message list.
  3. https://docs.novu.co/api/get-messages/

It sorted by ascending

👍 Expected behavior

Expect can have filter read/seen/unseen/unread either one & filter by descending date time

👎 Actual Behavior with Screenshots

https://docs.novu.co/api/get-messages/

This API dont have parameter sort descending & filter seen/unseen

📃 Provide any additional context for the Bug.

{ "page": 0, "totalCount": 3, "pageSize": 10, "data": [ { "_id": "63f075b83545ebaa5649ca0c", "_templateId": "63ec38423545ebaa564937c2", "_environmentId": "63d140193545ebaa5647f705", "_messageTemplateId": "63ec38ea3545ebaa564938c2", "_notificationId": "63f075b83545ebaa5649c9f0", "_organizationId": "63d140193545ebaa5647f6ff", "_subscriberId": "63e600e73545ebaa5648c205", "_jobId": "63f075b83545ebaa5649c9f5", "cta": { "action": { "buttons": [] } }, "channel": "push", "content": null, "providerId": "fcm", "deviceTokens": [ [ "dQA2tAMGSJ6pBNtM8CA6Gh:APA91bFCJ8BGmhAJ_Nmnii03A5-qL3Bh7IXoiazIAHHn3L3rS4BiU4hjqg7OWkXIwbVQUO7sici6TCZ0YHCIpl_HvF0NaWIS4ei3UsZKm6CGbfxeM6oDa4p1arC4U3gKJhIJXJzKVZe9" ] ], "title": "System Notice: App is under going maintenance", "seen": false, "read": false, "status": "sent", "transactionId": "7dd1098b-5793-43cc-82a4-c1f283d51a47", "payload": { "message": "This is testing", "type": "System Notice" }, "deleted": false, "createdAt": "2023-02-18T06:52:40.890Z", "updatedAt": "2023-02-18T06:52:40.890Z", "v": 0 }, { "_id": "63f08c973545ebaa5649ce90", "_templateId": "63ec38423545ebaa564937c2", "_environmentId": "63d140193545ebaa5647f705", "_messageTemplateId": "63ec38ea3545ebaa564938c2", "_notificationId": "63f08c973545ebaa5649ce74", "_organizationId": "63d140193545ebaa5647f6ff", "_subscriberId": "63e600e73545ebaa5648c205", "_jobId": "63f08c973545ebaa5649ce79", "cta": { "action": { "buttons": [] } }, "channel": "push", "content": null, "providerId": "fcm", "deviceTokens": [ [ "dQA2tAMGSJ6pBNtM8CA6Gh:APA91bFCJ8BGmhAJ_Nmnii03A5-qL3Bh7IXoiazIAHHn3L3rS4BiU4hjqg7OWkXIwbVQUO7sici6TCZ0YHCIpl_HvF0NaWIS4ei3UsZKm6CGbfxeM6oDa4p1arC4U3gKJhIJXJzKVZe9" ] ], "title": "System Notice: App is under going maintenance", "seen": false, "read": false, "status": "sent", "transactionId": "d922d688-4979-4746-8222-5f47c60e17cb", "payload": { "message": "This is testing 2", "type": "System Notice" }, "deleted": false, "createdAt": "2023-02-18T08:30:15.216Z", "updatedAt": "2023-02-18T08:30:15.216Z", "v": 0 }, { "_id": "63f08d483545ebaa5649cf8e", "_templateId": "63ec38423545ebaa564937c2", "_environmentId": "63d140193545ebaa5647f705", "_messageTemplateId": "63ec38ea3545ebaa564938c2", "_notificationId": "63f08d473545ebaa5649cf72", "_organizationId": "63d140193545ebaa5647f6ff", "_subscriberId": "63e600e73545ebaa5648c205", "_jobId": "63f08d473545ebaa5649cf77", "cta": { "action": { "buttons": [] } }, "channel": "push", "content": null, "providerId": "fcm", "deviceTokens": [ [ "dQA2tAMGSJ6pBNtM8CA6Gh:APA91bFCJ8BGmhAJ_Nmnii03A5-qL3Bh7IXoiazIAHHn3L3rS4BiU4hjqg7OWkXIwbVQUO7sici6TCZ0YHCIpl_HvF0NaWIS4ei3UsZKm6CGbfxeM6oDa4p1arC4U3gKJhIJXJzKVZe9" ] ], "title": "System Notice: Water Disruption at Level 3 ", "seen": false, "read": false, "status": "sent", "transactionId": "138536c4-7f0f-41ef-a950-f83290725897", "payload": { "message": "This is testing 2", "type": "System Notice" }, "deleted": false, "createdAt": "2023-02-18T08:33:12.038Z", "updatedAt": "2023-02-18T08:33:12.038Z", "__v": 0 } ] }

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

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

Yes I am willing to submit a PR!

NV-1726

scopsy commented 1 year ago

Hi @stefanlam88 when implementing a notification center feed please use the following endpoint:

This endpoint is sorted correctly and has the seen filter added to it. Could you please take a look?

oba2311 commented 1 year ago

@unicodeveloper @jainpawan21.novu I'm closing this one as its been over a week.