-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marking feed notifications as read/seen does not return updated data #423
Comments
Agent comment from Anders Lund in Zendesk ticket #9687: This is expected behavior. As per the docs:
I'll link you to this section here: https://getstream.io/activity-feeds/docs/javascript/flat_feeds/?language=javascript. |
Thanks for the quick response. Question though...marking the notifications as changed means they are now different, and means I as the client know the old AND new data. I don't see a reason to need the old data again. If I'm marking something as changed, that means I have what I need on my end, but I want the data provider to send me its latest. I don't see a purpose for telling the server the data has changed (meaning I know the old AND new data) just to have the server send me the old data again. Please help me understand a use case for this design. Thank you. |
Side note: It seems that a PUT or POST might make more sense than a GET here to make changes to activity data. If you don't mind, I'd love to understand this design choice also. Thank you, we are designing our api to work well with yours or others, so we want to be explicit when we can. |
Hi guys! Glad we're opening a discussion around this (: @shodgetts I am also curious as to why this endpoint behaves in this manner. From an implementation perspective, if I make a request and explicitly set Echoing @mboraski 's last comment, since this endpoint is modifying data, I too am curious why the choice to make it a GET was used over a PUT. It seems more scalable and less complicated to separate fetching from updating. Lastly, based on some documentation we found, it seems this endpoint can also accept a list of Thanks! |
@micha3ldavid the reason a feed.get with mark_read=true returns the previous state is to avoid calling the API twice (read and mark). Facebook's notification dropdown is a good example, it shows the current count of unseen posts and as you click on it you can see the ones that are counted as unseen + dismiss their state. |
@tbarbugli Sorry, it still doesn't make sense to me. If I make a request to fetch a list of notifications along with the This endpoint also falls short when I want to set a single notification to 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 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
Alternatively 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 |
Hello - Stephen here from the Stream Customer Success department. Thank you for all of the feedback - we've been keeping an eye on this issue. Are you currently a Stream customer? If so, do you mind please sending your organization id? You're also welcome to email support@getstream.io too. |
Hi @shodgetts, thanks for reaching out. I'm a little disappointed you don't remember Michael and I. We all had a video zoom meeting a little over a month ago. Yes we are a Stream customer. I don't feel comfortable sending the organization id over a public forum, but we can chat through support. I already opened a support ticket through the email you mentioned on February 24. I had a chat with Anders Lund. Please check your support history for details. |
Also, do you have a client that is consuming/using this endpoint in the way you have it implemented? We would love to ask them about it and learn if there is some benefit we just are not seeing. Thank you. |
Agent comment from Stephen Hodgetts in Zendesk ticket #9687: |
We are experiencing the same issue. Our current workaround is to call the feed.get(mark_seen=True) API twice. |
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. |
What steps will reproduce the bug?
Mark individual or groups of notifications as read/seen returns unchanged data
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
The text was updated successfully, but these errors were encountered: