Marking feed notifications as read/seen does not return updated data
See original GitHub issue- Version: 5+
- System: Node.js
What steps will reproduce the bug?
Mark individual or groups of notifications as read/seen returns unchanged data
client.feed('notification', feedId).get({ limit: 10, mark_read: notificationId })
client.feed('notification', feedId).get({ limit: 10, mark_seen: true })
or directly…
https://api.stream-io-api.com/api/v1.0/enrich/feed/notification/[userId]/?api_key=[key]&limit=10&mark_read=0fd5ag06-7677-11eb-8080-800096ace01e.like_2021-01-13
What is the expected behavior?
Endpoint returns data with specific notifications marked true
is_read: true
What do you see instead?
is_read property is still false. A second call for fresh notification data is required.

Additional details
Seeing the same behavior for marking notifications “seen”
gz#9687
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
getstream-io notification feed mark_read response seems ...
When reading a feed with mark_read or mark_seen, the APIs return the seen/read of activities before they get updated by the request. This...
Read more >Mark All Messages As Read - Microsoft Community Hub
Sometimes a LOT of alerts are generated and the Activity feed is spammed up with dozens of unread notifications that realistically will never...
Read more >React library API reference - Knock Docs
onOpenfunctionA function that's invoked whenever the feed popover is opened, useful for updating any items in view and marking them as read, seen,...
Read more >Inbox improvements: marking notifications as read/unread ...
In this update, opening the inbox will no longer automatically mark all notifications as read. Instead, unread notifications will be only ...
Read more >How can I start to build a notifications system with a database ...
NotificationState (this can be an enum class, specifying whether the notification is 'Read', 'Seen' or 'Unread'.) ReadDate (DateTime: when user read the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tbarbugli Sorry, it still doesn’t make sense to me.
If I make a request to fetch a list of notifications along with the
unseed
andunread
fields, I am not going to pass themark_read=true
ormark_seen=true
flag to the endpoint because the user has not seen or read those notifications yet. The user may never decide to see or read those notifications and so I do not want to make the assumption they will, but I do want to render the UI and the unseen/unread count for them. So, my first request will be without themark_read
ormark_seen
flag. If/When the user decides to open the dropdown and see/read the notifications then I would like to mark them asread/seen
and I would expect the most up-to-date state of the data to be returned because I explicitly asked the endpoint to update the data. Asking an endpoint to perform an action and not returning the results of that actions is not only confusing but problematic.This endpoint also falls short when I want to set a single notification to
read
orseen
. If I passmark_read=<notification_id>
to the endpoint it returns me an entire list of recent notifications again (along with the incorrect previous state mentioned above). I don’t actually want an entire list of notifications I just want the one notification I requested to be marked asread
.Personally, I think this endpoint is trying to do way too much and makes too many assumptions. It forces frontend applications to conform to its very restrictive design pattern rather than allowing frontend applications the flexibility to make their own design and state management decisions. This is one of the major reasons the separation of
GET
fromPUT
was created. The fact that this endpoint merges these two concepts together and attempts to help manage a frontend application’s state is not only confusing but concerning for me.Due to the implementation of this endpoint, I would rather not use it for anything other than fetching the most recent list of notifications. Do you have alternative endpoints we can use? I see little documented about notifications. I know that notifications are just a type of
feed
but they have special behavior associated with them and their data is shape differently. Ideally, we are looking for a way to:read/seen
and return the most up-to-date state for that notificationread/seen
and return the most up-to-date state of that array of notificationsAlternatively an endpoint that returned the number of unseen/unread notifications would better enable us to use your design pattern. Our UI renders a bell icon with the number of unread recent notifications so we need that data before the user ever interacts with the dropdown, which is why we make the initial request for the notifications without the
mark_seen
mark_read
flags. If we had a way to fetch the number of unread/unseen notifications we could delay the request for recent notifications until the user opened the dropdown, allowing us to set themark_seen
andmark_read
flags and leverage your endpoints current behavior.We’re having similar integration issues, I wonder if this could also be mitigated by adding a subscription event that pushed the lasted unseen/unread counts of the feed. (This would also allows apps to update their internal state for things like bell icons/badges indicating a user has unread/unseen notifications.)
Then the caller would get a push event of the result of the PUT masquerading as a GET. So something like:
Though I guess this would be a breaking API change since it’s possible developers would expect at least one of “deleted” or “unseen” to be a truthy array and now both could be empty.