thewca / worldcubeassociation.org

All of the code that runs on worldcubeassociation.org
https://www.worldcubeassociation.org/
GNU General Public License v3.0
328 stars 176 forks source link

Former trainee delegate no longer listed #7908

Open OJCubing opened 1 year ago

OJCubing commented 1 year ago

Describe the bug Former trainee delegate no longer listed for competitions they have delegated.

To Reproduce Matthew Preswich (2016PRES04) was a trainee delegate at Wakefield Open 2022 and Weston-super-Mare Open 2022. You can see from this query that he doesn't appear in the competition_delegates table at all, nor in the competition_trainee_delegates table.

Expected behavior Trainees should still be listed for competitions they delegated, even if they aren't a trainee anymore.

Additional context I know the way that trainee delegates are stored on the website has changed recently. I'm worried that this was lost in the process. My main concern is there may be more delegates who have gone missing too - perhaps someone with a database export from before the change would be able to confirm more?

dunkOnIT commented 1 year ago

@danieljames-dj do you have any insight on this? I feel like it may have been resolved, but I'm not familiar with the changes that were made when this issue was created.

gregorbg commented 1 year ago

We only have one "Delegates for a competition" table and the display on the website is done by filtering who are trainees at the time that the website is being displayed. So indeed this is a flaw in our current design.

MattSteven98 commented 10 months ago

Hey all, I don't suppose there's any update on this issue, or any potential workaround? Appreciate it's probably not priority for WST so not necessarily expecting any global fix but I'm sure you can appreciate it's frustrating to seemingly be the only former trainee delisted.

dunkOnIT commented 10 months ago

Hi @MattSteven98, unfortunately we wouldn't consider a workaround for an issue of this nature - the time taken + risk of bugs/unintended consequences just isn't justified by the outcome.

Totally understand the frustration, and I'm really sorry that you've been put in this position. We are in the process of a delegate and roles rework that should naturally resolve this issue in the next few months.

MattSteven98 commented 9 months ago

Thanks for your response @dunkOnIT, appreciate the update! Happy to hear the issue should resolve itself in the coming months.

danieljames-dj commented 9 months ago

@OJCubing @MattSteven98: I just checked some competitions that I delegated which had trainee delegates. I found that trainee delegates are still listed there. So I strongly guess this got removed due to some other reason. Is this the only competition where you found that trainee delegate is not listed or is there any other competition as well?

dunkOnIT commented 9 months ago

Hi Daniel, would this not be because trainees you've delegated with are still delegates of some form, while Matt no longer has delegate status?

gregorbg commented 9 months ago

Chiming in: This is unrelated to Daniel's current migration. We have a table in the DB that stores "competition <-> Delegate" links by simply storing rows of the format "competition ID, Delegate ID, does that Delegate want to receive notifications for this specific competition".

The problem with that format is that we check who is a Trainee Delegate at runtime, i.e. every time the page is displayed to a user. So if you are currently a Trainee, it works as expected, but if you get promoted (or demoted, for that matter) months after the competition, the historical fact that you were a Trainee back then is not accurately reflected.

Note that this has a potential fix for when Daniel's role migration is fully completed, but it is not inherently related to his work.

OJCubing commented 1 week ago

Bumping this now that the delegate migration has finished.