Opened 10 months ago
Closed 5 months ago
#9160 closed enhancement (fixed)
Anonymising message data for deleted users in the REST API
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 15.0.0 | Priority: | highest |
Severity: | normal | Version: | 12.5.0 |
Component: | REST API | Keywords: | has-patch has-unit-tests needs-testing |
Cc: |
Description
Hi,
We've noticed a difference between how the private messages of a deleted user are handled within the REST API, compared to the website.
If a user on the website deletes their account after sending messages, the other recipients within a private message thread can still read the thread, but will see "Deleted User" in place of the deleted user's Name, and [deleted] for any messages the deleted user has sent.
In the REST API, all of the private messages sent by a deleted user are still visible. Is it possible for the REST API to anonymise this data in the same way that the website does, so that there's parity between the two?
We've tested all of the above with the following set-up:
- WordPress version: 6.5.3
- BuddyPress version: 12.5.0
- BuddyPress Template: Legacy
- Theme: Twenty Twenty-Four
- Plugins active: BuddyPress, JSON Basic Authentication (https://github.com/WP-API/Basic-Auth)
- PHP: 7.4
Thanks.
Attachments (5)
Change History (29)
#2
@
10 months ago
Hi @espellcaste
Sure, please see below.
- Create two accounts (e.g. David and Fred).
- Create a private message thread between these two accounts, and send multiple messages back and forth between the two users. See first attached image for an example of what this could look like on the website.
- Delete one of the users (E.g. David).
- View the message thread on the website, using Fred's account. You'll see that all messages from the deleted user have been anonymised to "[deleted]", and their Name is now "Deleted User", as in the second attached image.
- View the message thread through the REST API as Fred, using GET /wp-json/buddypress/v1/messages/<threadID>. You'll see that all messages from David are still visible, i.e. they have not been anonymised. The third attached image is an example from this thread where a message hasn't been anonymised (i.e. the "Do you like to travel?" line).
#3
@
10 months ago
Hi @espellcaste
Just to add to this, the non-deleted user can still see a preview of the most recent message sent by the deleted user, on both the website (website.com/members/me/messages/) and through the REST API (GET /wp-json/buddypress/v1/messages). We've attached a screenshot of what the web inbox looks like before and after the user deletes their account, for reference.
Is this intentional, or should that data also be anonymised on both the website and REST API when the user is deleted?
Thanks.
#4
@
10 months ago
- Component changed from REST API to Messages
- Milestone changed from Awaiting Review to 14.0.0
- Status changed from new to assigned
@niftythree I can confirm the issue.
I actually see a few more issues in the web version and the REST API too. Like the ability to star a deleted message (I don't see the purpose here), etc.
I'll work on a fix.
This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.
10 months ago
This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.
10 months ago
This ticket was mentioned in PR #340 on buddypress/buddypress by renatonascalves.
8 months ago
#9
- Keywords has-patch has-unit-tests added
Trac ticket: https://buddypress.trac.wordpress.org/ticket/9160
#10
@
8 months ago
@niftythree https://github.com/buddypress/buddypress/pull/340 addresses the issue on both the web and REST API versions.
#11
@
8 months ago
Hi @espellcaste. We've had a quick look.
Messages (we used a one-on-one private messaging conversation):
REST API looks be working OK.
These concern the web version:
- All message excerpts showing as [deleted], including conversations between existing (i.e. non-deleted) members.
- Legacy template: Within a thread, the links to the other existing participant's profile has been removed.
- Nouveau template: Deleted users have a "/false" at the end of the link when viewing messages in the thread list e.g. /members/<yourprofile>/messages/sentbox/false
Thanks.
This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.
6 months ago
This ticket was mentioned in PR #380 on buddypress/buddypress by renatonascalves.
6 months ago
#15
Trac ticket: https://buddypress.trac.wordpress.org/ticket/9160
This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.
5 months ago
This ticket was mentioned in PR #384 on buddypress/buddypress by renatonascalves.
5 months ago
#18
Trac ticket: https://buddypress.trac.wordpress.org/ticket/9160
#19
@
5 months ago
- Keywords needs-testing added
@niftythree Can you test this latest pr (https://github.com/buddypress/buddypress/pull/384) to address your initial issues (non-REST API related)?
#20
@
5 months ago
Hi @espellcaste, we've had a quick look.
Web version:
- All message excerpts showing as [deleted], including conversations between existing (i.e. non-deleted) members.
- Looks to be fixed now.
- Legacy template: Within a thread, the links to the other existing participant's profile has been removed.
- Looks to be fixed now.
- Nouveau template: Deleted users have a "/false" at the end of the link when viewing messages in the thread list e.g. /members/<yourprofile>/messages/sentbox/false
- Still seeing /false issue on Nouveau.
Some other things we've noted:
- Nouveau template: the username is displayed under the first column, instead of their profile name, but only in the Sent box. The Inbox and Starred folders display the user's profile name as normal.
- Legacy template: when a user is deleted, the Inbox and Starred folders display [deleted] under the "From" column. In the Sent box, it's displayed as "Deleted User".
Thanks.
#21
@
5 months ago
@niftythree Thanks for the feedback. I updated the pull request with your feedback. Could you try it again and confirm the things you noted?
#22
@
5 months ago
Hi @espellcaste
Thanks for your work on this. We've had a look, please see our notes below:
Web version:
Nouveau template:
- Deleted users have a "/false" at the end of the link when viewing messages in the thread list.
- Still seeing /false issue on Nouveau, but now only in the Inbox and Starred folders e.g. /members/<yourprofile>/messages/inbox/false
- The username is displayed under the first column, instead of their profile name, but only in the Sent box. The Inbox and Starred folders display the user's profile name as normal.
- Still present.
Legacy template:
- When a user is deleted, the Inbox and Starred folders display [deleted] under the "From" column. In the Sent box, it's displayed as "Deleted User".
- Looks to be fixed now.
Thanks.
@niftythree Could you share the endpoint and requests you are performing? With some steps for both the web and REST API, if possible. It'll help with replicating the issue and coming with the right solution.