Opened 3 years ago
Closed 2 years ago
#8696 closed defect (bug) (fixed)
BP REST API Messages endpoint does not return latest message in excerpt field
Reported by: | niftythree | Owned by: | espellcaste |
---|---|---|---|
Milestone: | 12.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | dev-reviewed has-patch has-unit-tests |
Cc: |
Description
Hello again,
As you may know from our previous thread, we’re working on the messaging portion of our mobile app which interfaces to the BP REST API. We’ve noticed that the “messages” endpoint in the API returns an “excerpt” which is quite handy. However, it’s not necessarily the excerpt of the most recent message, instead it's an excerpt of the last message in the current batch returned by the API. To get the actual latest message it is necessary to call the messages endpoint repeatedly until it has reached the end of each of the message threads, which is not very efficient from the app’s end and slows things down quite a bit. Would it be possible to change this so that the excerpt returned is of the latest message? (i.e. when retrieving the Inbox, the excerpt would be the last incoming message, when retrieving the Sentbox the excerpt would be from the last outgoing message).
Thank you.
Attachments (1)
Change History (11)
#1
@
3 years ago
- Keywords needs-patch dev-reviewed added
- Milestone changed from Awaiting Review to Up Next
- Owner set to espellcaste
- Status changed from new to assigned
- Type changed from enhancement to defect (bug)
This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.
3 years ago
#3
@
3 years ago
Hi @espellcaste,
Thanks for looking into this. We actually thought this was how it was originally intended to work. 🙂
This ticket was mentioned in PR #52 on buddypress/buddypress by renatonascalves.
2 years ago
#6
- Keywords has-patch has-unit-tests added; needs-patch removed
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8696
renatonascalves commented on PR #52:
2 years ago
#7
@imath Could you take another look? I improved the implementation to handle the cache in a better way.
@niftythree Good catch! This is actually a bug in the implementation. Since we are getting paginated batch of messages, we are actually losing the last one which is the lastest message.
I'll work on a fix.