Closed ajones05 closed 7 years ago
Looks like this behaviour has changed on server side. All I was doing on client side was to fetch latest list of alerts and count unread alerts whenever the user tapped one (at that point we also used mobile/notification-read api to mark it read before fetching updated list). It is still the same on my side. Perhaps something changed on server side with 'mobile/notification' api. @yuriyua can tell better.
@yuriyua did you make a change? I didn't think you were making any changes at the moment?
@abdulhafeez These are response examples. What should I change?
Response before "tap":
{
"status": "SUCCESS",
"result": [
{
"id": "277",
"type": "message",
"is_read": "0",
"created_at": "2016-11-06 01:22:37",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"message": "Yuriy Kurilyuk 2 sent you a new message"
},
{
"id": "276",
"type": "message",
"is_read": "0",
"created_at": "2016-09-25 23:59:18",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"message": "Yuriy Kurilyuk 2 sent you a new message"
},
{
"id": "275",
"type": "message",
"is_read": "0",
"created_at": "2016-09-25 23:58:40",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"message": "Yuriy Kurilyuk 2 sent you a new message"
},
{
"id": "3742",
"type": "comment",
"is_read": "0",
"created_at": "2016-08-10 05:40:05",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2561",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3614",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 01:11:15",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3613",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 01:02:29",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3612",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:56:40",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3611",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:54:31",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3610",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:23:20",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3609",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:22:19",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
}
]
}
Response after "tap":
{
"status": "SUCCESS",
"result": [
{
"id": "277",
"type": "message",
"is_read": "1",
"created_at": "2016-11-06 01:22:37",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"message": "Yuriy Kurilyuk 2 sent you a new message"
},
{
"id": "276",
"type": "message",
"is_read": "0",
"created_at": "2016-09-25 23:59:18",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"message": "Yuriy Kurilyuk 2 sent you a new message"
},
{
"id": "275",
"type": "message",
"is_read": "0",
"created_at": "2016-09-25 23:58:40",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"message": "Yuriy Kurilyuk 2 sent you a new message"
},
{
"id": "3742",
"type": "comment",
"is_read": "0",
"created_at": "2016-08-10 05:40:05",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2561",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3614",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 01:11:15",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3613",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 01:02:29",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3612",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:56:40",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3611",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:54:31",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3610",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:23:20",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
},
{
"id": "3609",
"type": "comment",
"is_read": "0",
"created_at": "2016-07-12 00:22:19",
"user_id": "302",
"user_name": "Yuriy Kurilyuk 2",
"user_image": "http://www.seearoundme.local/uploads/default.jpg",
"post_id": "2311",
"message": "Yuriy Kurilyuk 2 commented on your post"
}
]
}
This response is OK. I am getting the same and I don't see this issue with 10 or less than 10 alerts. May be the problem happens when alerts are more than 10 but I could not reproduce that either.
Log into my account, since it has a lot of alerts, and you should be able to see the issue: vvhatif@gmail.com Resource17
This screen shot shows the log out put I am getting:
It is all coming from server side. You can see that on start, 3957 is the first alert and 3933 is the second. When I click the first alert, it is marked read and then new alert list is fetched. This new alert list does not have 3957 ... it has 3933 as the first alert. It also has a new alert at the end of the list (3791). So, it is clear that this is happening on server side. It seems the server is ignoring the alerts where is_read = 1 and including new unread alert.
I think what @yuriyua should do is keep returning same list of 10 alerts until all 10 are marked read. When all 10 are marked read, return next 10. @ajones05 is that the correct logic?
Let me check
I think what @yuriyua should do is keep returning same list of 10 alerts until all 10 are marked read. When all 10 are marked read, return next 10.
No, it should just show the most recent 10 alerts, whether they are read or not. However, once an alert has been read, it should appear gray (marked as read). It used to function this way, but something changed recently where alerts that have been read are no longer shown, even if it is one of the 10 most recent.
I see issue. Let me fix it.
I think then the only wrong thing is that server is excluding the read alert ... but but but ... server may be doing it right as it picks most recent ... quite complex
Thanks @yuriyua @abdulhafeez it should be simple:
In the list we load notification for latest 2 weeks. I made query for load unread notifications for unlimited date OR all notificatin for latest two weeks
...
is_read=0 OR created_at>'2016-10-22 00:00:00'
....
Remove OLD notifications from the list?
These are old notifications
Remove OLD notifications from the list?
I mean more than two weeks old unread notifications
Old notifications should always be removed, so only the newest 10 alerts are shown (whether they have been read or not). Let me know if some examples would help...
is_read=0 OR created_at>'2016-10-22 00:00:00'
This query seems to ignore read messages. Should you not remove is_read=0 condition?
done
I checked and now have no alerts, so unless I am missing something it seems something is still not right.
I made fer requests to your account. Can you test it again, please?
I still see no alerts. I see I have a new message if I go manually to messages, though.
I just logged out, logged in as another user - looked fine. Logged back in with the original account and it looks fine now, too
The alerts for messages aren't working (if you tap on it, nothing happens). Only the alerts for "X user liked/commented on your post" seem to be working.
...
{
"id": "215",
"type": "message",
"is_read": "1",
"created_at": "2016-11-08 08:00:54",
"user_id": "276",
"user_name": "Yuriy Kurilyuk",
"user_image": "http://www.seearound.me/uploads/default.jpg",
"message": "Yuriy Kurilyuk sent you a new message"
},
...
It was marked as read. @abdulhafeez can you test it from your side?
It used to show just the last 10 alerts. If you tapped on one, the count would go down to 9 and the one you viewed would be gray.
Now, however, the one that was tapped disappears and the next unread alert appears added to the list, so the number stays at 10.
I'm sure there is a better way to manage alerts, but for now pleaser change it back to how it was (show only the 10 most recent alerts and when tapped they turn gray and the number of alerts goes down).