Closed jmgasper closed 1 year ago
REF: https://topcoder.atlassian.net/browse/PROD-4259
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
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:
X-Total-Pages
perPage
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)
https://github.com/topcoder-platform/topcoder-react-lib.git
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:
X-Total-Pages
header in the response is >1perPage
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