microsoft / EmbeddedSocial-iOS-SDK

SDK for interacting with the Microsoft Embedded Social service from inside your iOS app
MIT License
19 stars 11 forks source link

Notifications|Activities issue #729

Closed IgorPopov-MS closed 7 years ago

IgorPopov-MS commented 7 years ago

Issue:

Currently my account has 3 notifications, application shows 3 activities in activity tab. Upon pressing on each of activity application submits it as read via the API. Server returns 409 with following message:

code: 409 Conflict message: { "message": "Newer item exists" }

Server continues responding with notifications count => 3 and user cant decrease it.

Steps:

1.

Getting activities

GET /v0.7/users/me/notifications HTTP/1.1 Host: ppe.embeddedsocial.microsoft.com Authorization: SocialPlus TK=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIzdHBwbzZkbHlHSFxuR29vZ2xlXG4xMDUxNzg4MTQ0MzM4MTk0NzE4ODIiLCJpc3MiOiIzdm4tNUJOZUFnV1xuZWMxNjY1YTQtOTIwZC00NDQ5LWI4YTAtNDllZDM3NGQ0MjkwIiwiZXhwIjoxNTIxOTc2OTc0fQ.Pu-dFTsaTxKZUTwzTPEr4CATpHAC7Lscp8Mki7wjbm8

2.

Sending "read notification" with activity handle from result above

PUT /v0.7/users/me/notifications/status HTTP/1.1 Host: ppe.embeddedsocial.microsoft.com Authorization: SocialPlus TK=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIzdHBwbzZkbHlHSFxuR29vZ2xlXG4xMDUxNzg4MTQ0MzM4MTk0NzE4ODIiLCJpc3MiOiIzdm4tNUJOZUFnV1xuZWMxNjY1YTQtOTIwZC00NDQ5LWI4YTAtNDllZDM3NGQ0MjkwIiwiZXhwIjoxNTIxOTc2OTc0fQ.Pu-dFTsaTxKZUTwzTPEr4CATpHAC7Lscp8Mki7wjbm8 Content-Type: application/json

{ "readActivityHandle": "3rIUTDmaHWa" }

IgorPopov-MS commented 7 years ago

Activities Get Result : users:me:notifications.txt Note: initial response cursor leads to an empty page with another cursor which leads to another empty page which has nil cursor. { 3 items } => { 0 items } => { 0 items } => nil

IgorPopov-MS commented 7 years ago

I think this also affects #690 .

sharadagarwal commented 7 years ago

You will get a 409 conflict if you have already done a PUT on the status for the same activityHandle or a more recent activityHandle. Right now, when I query the notification feed for this user, all the activities that are sent back are marked as read (i.e. unread==false). So if you do a PUT on the notification status for any of these activities you will get back a 409. Please note that doing a PUT on the status of an activityHandle marks that activity and all older activities as read.

orezhko commented 7 years ago

Implemented a change to sent read status to server for "You" activity feed