bracket icon indicating copy to clipboard operation
bracket copied to clipboard

Possible oversight when rendering Swiss matches.

Open robigan opened this issue 1 year ago • 2 comments

The page to view Swiss matches might include a slight oversight wherein it seems to assume that stageItem will always succeed. I see that there is an if check on https://github.com/evroon/bracket/blob/48ba51a3e72be7868d2b327d2393c6fb4812b7cd/frontend/src/pages/tournaments/%5Bid%5D/swiss/%5Bstage_item_id%5D.tsx#L78 before fetching additional data but the latter half of the if check is useless as Next will always assure a non-nullable value, and it doesn't actually check that the data exists in the DB to begin with. When a page is requested with an ID that doesn't exist in https://github.com/evroon/bracket/blob/48ba51a3e72be7868d2b327d2393c6fb4812b7cd/frontend/src/pages/tournaments/%5Bid%5D/swiss/%5Bstage_item_id%5D.tsx#L78-L82 it attempts to query further data, but it fails causing an error to be bubbled up. I would propose moving up the if check, removing the latter half of the check, making the variables defined use the useState hook rather than define them using let and implementing another if check to validate that the correct data is queried.

robigan avatar Jul 14 '24 08:07 robigan

This issue is stale because it has been open for 60 days with no activity. What is the action to take here?

github-actions[bot] avatar Sep 13 '24 08:09 github-actions[bot]

This issue is stale because it has been open for 60 days with no activity. What is the action to take here?

github-actions[bot] avatar Nov 13 '24 08:11 github-actions[bot]