topcoder-platform / community-app

React webapp for serving Topcoder Community
125 stars 214 forks source link

User can't able to register for Development Practice Challenge #6878

Closed jmgasper closed 1 year ago

jmgasper commented 1 year ago

REF: https://topcoder.atlassian.net/browse/PROD-4259

Reported issue:

User is not able to register on challenges where registration count is more than 1000 Sample Challenge:

https://www.topcoder.com/challenges/030bdfc4-37d1-4b71-80a4-cbc6173a7a06

Investigation

The registration actually works and is accepted, but isn't displayed on the challenge details page and an error message is erroneously displayed.

The problem here is how we use the resources API. By default, when making a call for the resources on a challenge, we send this:

https://api.topcoder.com/v5/resources?challengeId=030bdfc4-37d1-4b71-80a4-cbc6173a7a06&roleId=732339e7-8e30-49d7-9198-cccf9451e221

This returns the first of two pages of results, but we don't properly handle the second page, so we'll only ever see the first 1000 registrants.

To fix, we should:

  1. Either handle the subsequent pages, if the X-Total-Pages header in the response is >1
  2. Or, just add a higher perPage flag to the URL, like https://api.topcoder.com/v5/resources?challengeId=030bdfc4-37d1-4b71-80a4-cbc6173a7a06&roleId=732339e7-8e30-49d7-9198-cccf9451e221&perPage=5000
suppermancool commented 1 year ago

This should be done in https://github.com/topcoder-platform/topcoder-react-lib.git repo Done in topcoder-react-lib-issue-6878.patch (commit c6830080f1025e328c005a5ce0f9ac57032c9b6f develop branch)