Page MenuHomePhabricator

Add support for private registration to the backend code
Closed, ResolvedPublic2 Estimated Story Points

Description

General background: This is a back-end only ticket, but here is some context on the front-end:

  • Private registrant usernames should be displayed to organizers
    • Organizers should see some visual indicator of who is a private registrant. We are still determining what is the icon of choice, but it would be something like an eye that is crossed out next to the username of the private registrant.
    • Private registrant usernames should not be displayed to non-organizers. Instead, non-organizers should just see the number of private registrants in the participant list (for example: "13 private registrations"). The reason why we want to display the number of private registrations is so that people don't think we have a bug in our code and miscalculated the number of registrants.

Explanation of back-end work:

Once the new schema is in place (T318120), we will need to change the backend code so that it supports the concept of private registration. Possible summary of the things to do:

  • Add a boolean flag to the relevant method(s) in ParticipantsStore
  • Add a private field + getter to the Participant class
  • Add a fluent setter for this option to RegisterParticipantCommand
Acceptance criteria
  • Add the necessary logic to the backend code to allow private registration of participants
  • Update documentation of the "register for event" endpoint to include the new "private" parameter

Note: this would not be exposed in the UI yet.

Event Timeline

Daimona updated the task description. (Show Details)
ifried renamed this task from Add support for confidential registration to the backend code to Add support for private registration to the backend code.Sep 23 2022, 1:23 PM
ifried updated the task description. (Show Details)
vyuen set the point value for this task to 2.Sep 28 2022, 1:39 PM
ifried updated the task description. (Show Details)

@ifried To be precise, I wrote this task to be about the back-end only, noting that the functionality would not be exposed in the UI just yet; the task was also estimated according to those premises. So, I'm not sure if the AC about the interface would really belong here. I think it should be in T318954 instead.

@Daimona

Partially my fault here, I asked for more clarification as the existing ticket didn't give me all the information I required to complete this. But I agree this is additional context, not AC.

@Daimona Yes, this was just meant to be context after a conversation between Michelle and I. Anyway, I have moved the UI-related information to the top of the ticket (General Background) and out of the AC.

Change 839633 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Add support for private registrations

https://gerrit.wikimedia.org/r/839633

Change 839633 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Add support for private registrations

https://gerrit.wikimedia.org/r/839633

This can be tested together with T319455. For now, the expected behaviour is that private participants do not appear anywhere in the interface, not even if you're an organizer.

vaughnwalters added a subscriber: vaughnwalters.

A few feedback questions and notes on this:

For Organizers should see some visual indicator of who is a private registrant. We are still determining what is the icon of choice, but it would be something like an eye that is crossed out next to the username of the private registrant.

Currently there is no visual indicator. Is this expected? If so, we should just remove the above text from the description in this ticket.


The parameter will accept any string or number that is passed in, but should throw an error unless a boolean is passed in:

Screen Shot 2022-10-31 at 3.39.07 PM.png (1×1 px, 133 KB)


When a participant registers privately, their name is successfully hidden from Special:EventDetails, but still displays in the Event details modal, if logged in as the privately registered user:
vid:

Screen Recording 2022-10-31 at 3.44.30 PM.gif (1×2 px, 1 MB)

user on the left is the participant who privately registered:

Screen Shot 2022-10-31 at 4.17.40 PM.png (1×3 px, 494 KB)

A few feedback questions and notes on this:

For Organizers should see some visual indicator of who is a private registrant. We are still determining what is the icon of choice, but it would be something like an eye that is crossed out next to the username of the private registrant.

Currently there is no visual indicator. Is this expected? If so, we should just remove the above text from the description in this ticket.

Yes, it is expected. According to T318121#8281598 and following comments, it was included in the task description only as additional context, but it's not part of this task.

The parameter will accept any string or number that is passed in, but should throw an error unless a boolean is passed in:

Yeah, that is T305973. More generally, all parameters lack type validation in JSON. I think it's a very important feature, but it should be fixed in core. For now, I think we can just assume that it's up to clients to make sure that the parameter types match.

When a participant registers privately, their name is successfully hidden from Special:EventDetails, but still displays in the Event details modal, if logged in as the privately registered user:

Ah yes, this is indeed the only exception to "private participants do not appear anywhere in the interface". Currently you can always see your name in the "more details" modal even if you've registered privately. This is different in Special:EventDetails (your name wouldn't appear), but that'll change once T321750 is resolved.

When a participant registers privately, their name is successfully hidden from Special:EventDetails, but still displays in the Event details modal, if logged in as the privately registered user:

Ah yes, this is indeed the only exception to "private participants do not appear anywhere in the interface". Currently you can always see your name in the "more details" modal even if you've registered privately. This is different in Special:EventDetails (your name wouldn't appear), but that'll change once T321750 is resolved.

@Daimona Ah, okay. Then since the privately registered user actually should continue display in the "more details" modal as long as they are the user that is logged in, the bug is that the list in that "more details" modal decreases by one shown participant when a user registers privately. However, this only affects events with less than 10 participants, and only when viewing the "more details" modal logged in as the privately logged in participant. In the following example, when logged in as registered participant V, all three participants should display whether logged in privately or publicly:

If user V registered privately:

Screen Shot 2022-10-31 at 7.31.08 PM.png (1×2 px, 315 KB)

If user V registered publicly:

Screen Shot 2022-10-31 at 7.31.59 PM.png (1×2 px, 315 KB)

Let me know if this is not covered by another ticket (and if it's worth fixing) and I'll make another ticket and move this ticket on.

Okay thanks @MHorsey-WMF. Because the notes I mentioned in T318121#8358373 and T318121#8358663 will be covered by other tickets, I am moving this ticket to done/resolved.