Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow organizers to prevent any paid user from cancelling #10807

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

dunkOnIT
Copy link
Contributor

@dunkOnIT dunkOnIT commented Feb 10, 2025

I'm adding an enum so that we can give organizers more control over which users can cancel their registrations.

TODO:

  • Add enum
  • Replace all existing functionality of old field
    • Change tests
    • Replace all instances in code
  • Add validations for this new field (if any - haven't thought of any yet besides perhaps use_wca_registration)
  • Add tests against restrict_any_paid field - this is where we add the new feature of preventing cancellations by users who have paid
  • Update competition form
  • Frontend change to disable Cancel button in the payment case
  • Test out in frontend

This will deprecate allow_self_delete_after_acceptance, which we can remove in a follow-up migration after a few weeks of this running without issue in the wild.

@dunkOnIT dunkOnIT marked this pull request as ready for review February 11, 2025 07:55
Copy link
Member

@gregorbg gregorbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too wild about the naming scheme in general. Why are you coming at this from the "restrictions" perspective? In my opinion, the natural question to ask is "Are competitors allowed to cancel their own registrations?". And if that's the question, then the answer should be:

  • Yes, anytime.
  • Yes, but only if they aren't accepted yet.
  • Yes, but only if they haven't paid yet.

In your changes to the YAML file, you use descriptions which indicate when people are NOT allowed to cancel, but perhaps it's more accessible if you specify when you DO allow people to cancel.

@dunkOnIT
Copy link
Contributor Author

dunkOnIT commented Feb 13, 2025

EDIT: Disregard previous comment, a better version of the wording came to me in a dream

Copy link
Member

@gregorbg gregorbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a few seconds short of merging this, but then it occured to me: This changes user interaction with the competition form significantly!

Previously, the default for the old allow_registration_self_delete_after_acceptance used to be false. That means, if someone created a new competition and then ignored the relevant field in the form ("I know it's false by default, which matches what I always want for my competitions, so I just scroll over it") competitors would not be allowed to cancel.

That same behavior would now lead to the competitors being allowed to cancel anytime under any circumstances (default value for competitor_can_cancel is 0 which translates to :always). So the person from my first example who casually creates a competition might run into a complete misunderstanding.

Now of course we want to live in an ideal world where every Delegate and every organizers reads the full form carefully. But we are both adult enough to know how many people consciously read a 5-screen-long webform (that they use on a weekly basis) in great detail every single time. But this is something even WCAT (whose job it is to read the forms carefully) cannot catch easily because they don't know what the Delegate's original intention was. From WCAT's perspective, the default choice in the dropdown (when you ignore the field and don't touch it) could be the legitimate, willful intention of the Delegate who submitted the form.

Options:

  1. Send an email. Hope people will read it.
  2. Change the defaults around
    1. Please don't pick a non-zero default value for the raw DB column. Change the order of enum entries if anything
  3. Rename the whole enum again (not preferrable because we had already settled on a good name)

Copy link
Member

@gregorbg gregorbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another comment, indicating that we (probably?) need a fourth never state in the enum. And then we could fix my previous concerns rather easily by flipping the order of entries in the enum around, i.e. listing the new never first.

That would mean that peeps who rely on the default value get the exact same behavior as it used to be with the old boolean implementation

Comment on lines +397 to +398
else
false
Copy link
Member

@gregorbg gregorbg Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW this state is unreachable. Rails enum introduces validations under the hood that make sure you can never set any (in this case, integer) value that is not covered by the enum.

Do we want cases where the cancellation policy is just "straight-out nope"? In that case, we need a separate never enum constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow organizers to prevent users from cancelling paid registrations
2 participants