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

Organizer view disappears when in a series #10730

Open
AxelFl opened this issue Jan 28, 2025 · 9 comments
Open

Organizer view disappears when in a series #10730

AxelFl opened this issue Jan 28, 2025 · 9 comments

Comments

@AxelFl
Copy link
Contributor

AxelFl commented Jan 28, 2025

Describe the bug
The "Organizer view" page goes blank after a few seconds when it is added to a competition series.

To Reproduce
Steps to reproduce the behavior:

  1. Create two competitions that can be added to a competition series.
  2. Add them to the same series.
  3. Go to organizer view of any of the competitions.
  4. Wait a few seconds and the contents disappear.

Expected behavior
The page to not disappear.

Screenshots
Image

Desktop (please complete the following information):

  • OS: macOS 15.0
  • Browser: Firefox
  • Version: 134.0.2 (aarch64)

** Mobile:**

  • Device: AC2003
  • OS: Android 12
  • Browser: Firefox
  • Version: 134.0.2

Additional context
Tried in private mode as well.
Looking at the console it gives me a type error in MultiSearchInput.jsx when it all disappears, but I don't know enough about react to actually interpret it. My best guess is that there is a problem when it tries to load the list of other competitions in the series.

@gregorbg
Copy link
Member

Hm, I've been staring at the "Organizer View" of https://www.worldcubeassociation.org/competitions/Kungkuben2025/edit for over a minute now, and the page still hasn't gone blank.

By any chance, could you post a screenshot of the console error you're getting?

@AxelFl
Copy link
Contributor Author

AxelFl commented Jan 28, 2025

Image
Image
Image

@AxelFl
Copy link
Contributor Author

AxelFl commented Jan 28, 2025

Just tested safari on mac as well and it went blank again.

@gregorbg
Copy link
Member

Ah, got it! It's not the Series per se that is a problem. The issue here is that you're trying to link it to an unannounced (and thereby, "invisble") competition which you are not a Delegate of.

You were correct to suspect the search box: It tries to load flag and name details for all other competitions in the Series, but in this specific case it fails at DropinCubingPartille2025 -- that competition is not announced yet, but you are also not a listed Delegate there. So from a certain perspective, the backend is correct to suspect that you should not have access (under normal circumstances).

I agree that this is an annoying edge-case, do you have any suggestions how to handle this other than "give anybody access to any unannounced competitions on the planet"?

@AxelFl
Copy link
Contributor Author

AxelFl commented Jan 28, 2025

That is weird because I tried to create a new competition in order to "own" both of them but the same thing happened, but I must have had all three accidentally.
One option is to allow organizers in a series to see all others in the same series, but only allow people who control both to add them to the series in order to not create privilege escalation. Don't know how easy that would be in the current system though.

@gregorbg
Copy link
Member

One option is to allow organizers in a series to see all others in the same series

That is a nice idea, but has a very subtle problem: The moment that you're clicking "Add to series", you're only loading the series information. You haven't saved the competition yet (by hitting the fat blue "Save" button at the top/bottom of the form), so as far as the database is concerned the competition is not part of the series yet. That makes the check very impractical.

@AxelFl
Copy link
Contributor Author

AxelFl commented Jan 28, 2025

But isn't that ok if we only allow people with privileges to see both to click "Add to series"? So before it is clicked all the required privileges are had and then the ones for the other users are given when saved. Or am I missing something else?

The workaround of adding as an organizer and having WCAT remove when announcing will also work and is the simplest option in what clearly isn't a common occurrence.

@gregorbg
Copy link
Member

Yeah, for now I'd kindly ask you to try going ahead with the workaround. You may add a note to WCAT saying you discussed this issue with WST and it's not a trivial fix.

Re seeing the competition when adding to Series: That's a bug (or rather, an oversight). Permissions are never even checked for that "closeby competitions" table, and there could potentially be leaks (ie if World's isn't publicly announced yet but you just so happen to organize a competition closeby, then you would see its details there as an eligible Series partner).

We could certainly introduce permission checks there and it wouldn't even be terribly hard, but then we would run into the same issue: You wouldn't even see legitimate series partner candidates unless you're a listed Del/Orga over there as well. And in that case, even a "can see all Series siblings" permission check wouldn't help because then you're definitely not part of the Series yet.

Hrmpf. I have filed #10733 to prevent the website from crashing, although I have a gut feeling that that "solution" (skipping entries which don't yield a valid result) has side-effects that will come back to haunt is later.
Clearly, this isn't a common use-case and not trivial to figure out on an organizational level.

@AxelFl
Copy link
Contributor Author

AxelFl commented Jan 28, 2025

I don't actually need to access it, so it just not crashing should work for me if everything else works as expected. Thank you very much for the help!

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

No branches or pull requests

2 participants