Skip to:
Content

BuddyPress.org

Opened 10 months ago

Closed 5 months ago

#9160 closed enhancement (fixed)

Anonymising message data for deleted users in the REST API

Reported by: niftythree's profile niftythree Owned by: espellcaste's profile espellcaste
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:

Thanks.

Attachments (5)

1.png (29.6 KB) - added by niftythree 10 months ago.
First attachment
2.png (30.6 KB) - added by niftythree 10 months ago.
Second attachment
3.png (22.4 KB) - added by niftythree 10 months ago.
Third attachment
4.png (16.7 KB) - added by niftythree 10 months ago.
Web inbox before the user deletes their account
5.png (11.7 KB) - added by niftythree 10 months ago.
Web inbox after the user deletes their account

Download all attachments as: .zip

Change History (29)

#1 @espellcaste
10 months ago

@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.

#2 @niftythree
10 months ago

Hi @espellcaste

Sure, please see below.

  1. Create two accounts (e.g. David and Fred).
  2. 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.
  3. Delete one of the users (E.g. David).
  4. 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.
  5. 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).

@niftythree
10 months ago

First attachment

@niftythree
10 months ago

Second attachment

@niftythree
10 months ago

Third attachment

#3 @niftythree
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.

@niftythree
10 months ago

Web inbox before the user deletes their account

@niftythree
10 months ago

Web inbox after the user deletes their account

#4 @espellcaste
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.

Last edited 10 months ago by espellcaste (previous) (diff)

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

#7 @dcavins
10 months ago

  • Milestone changed from 14.0.0 to Up Next

#8 @imath
9 months ago

  • Milestone changed from Up Next to 15.0.0

This ticket was mentioned in PR #340 on buddypress/buddypress by renatonascalves.


8 months ago
#9

  • Keywords has-patch has-unit-tests added

#10 @espellcaste
8 months ago

@niftythree https://github.com/buddypress/buddypress/pull/340 addresses the issue on both the web and REST API versions.

#11 @niftythree
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.

#12 @espellcaste
7 months ago

  • Priority changed from normal to highest

#13 @espellcaste
7 months ago

  • Component changed from Messages to REST API

This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.


6 months ago

#16 @espellcaste
6 months ago

In 14037:

BP REST API: Anonymise message data for deleted users.

Messages from deleted users are anonymised properly.

Props niftythree.

See #9160

This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.


5 months ago

#19 @espellcaste
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)?

Last edited 5 months ago by espellcaste (previous) (diff)

#20 @niftythree
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 @espellcaste
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?

https://github.com/buddypress/buddypress/pull/384

#22 @niftythree
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.

#23 @espellcaste
5 months ago

@niftythree Thank you! I fixed those issues. Sorry for the back and forth. So many moving parts and details in that component.

https://github.com/buddypress/buddypress/pull/384

#24 @espellcaste
5 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 14061:

Improve deleted-user private messages in the web and REST API.

Private messages from a deleted user are properly anonymized in both the web and REST API.

Props imath, niftythree.

Closes https://github.com/buddypress/buddypress/pull/384
Fixes #9160

Note: See TracTickets for help on using tickets.