Skip to content

[$50]Challenge Listings: Challenges not loading for subcommunities #4393

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

Closed
SathyaJayabal opened this issue May 22, 2020 · 24 comments
Closed

Comments

@SathyaJayabal
Copy link
Collaborator

SathyaJayabal commented May 22, 2020

Challenge Listings: Challenges not loading for sub communities
User: TonyJ/appirio123
Example
https://test-community-app.topcoder-dev.com/__community__/blockchain/challenges?communityId=blockchain
Screenshot 2020-05-22 at 4 32 02 PM
Screenshot 2020-05-22 at 4 32 06 PM

@SathyaJayabal SathyaJayabal added the P1 Urgent (resolve within 24 hours) label May 22, 2020
@sushilshinde sushilshinde changed the title Challenge Listings: Challenges not loading for subcommunities [$50]Challenge Listings: Challenges not loading for subcommunities May 22, 2020
@SathyaJayabal
Copy link
Collaborator Author

@ThomasKranitsas can we have an ETA for this please?

@ThomasKranitsas
Copy link
Contributor

Currently, we're passing multiple group IDs as groupIds (eg https://api.topcoder-dev.com/v5/challenges/?groupIds=20000010%2C20000043&status=Active&perPage=50&page=1)

The V5 does not support that. It only accepts a group parameter which is a group name.

How should we handle this?

@sushilshinde @rootelement

@sushilshinde
Copy link
Collaborator

@ThomasKranitsas starting a discussion on slack

@rootelement
Copy link
Contributor

@ThomasKranitsas we're going to have to add a GET body like ES does for filtering on GroupIds, because they'll blow the query limit too quickly. Can you add this and update the swagger?

@rootelement
Copy link
Contributor

This is implemented on dev, however it's an AND search. If you

curl --location --request GET 'https://api.topcoder-dev.com/v5/challenges' \
--header 'Authorization: Bearer TOKENREMOVED' \
--header 'Content-Type: application/json' \
--data-raw '{ "groups": ["72a0b8a0-aa45-44f7-86c2-bf9de6321e5b", "304b042f-19f1-4d06-9788-104572eca795"] }'

It will only return challenges in both of those group ids. So please implement with the expectation that it will retrieve challenge in either group A or group B in the near future. Also, please note that is a GET with a body, not a query string. We did that so we can filter on multiple UUIDs and not blow out the query string limits.

@sushilshinde
Copy link
Collaborator

@ThomasKranitsas
Copy link
Contributor

@sushilshinde
This will also require frontend changes to:

  1. Use the UUIDs instead of the legacy IDs
  2. Pass them in the request body instead of the query string

@sushilshinde
Copy link
Collaborator

sushilshinde commented May 28, 2020

@ThomasKranitsas I have added new label. Once we have API fix, share PR.

@ThomasKranitsas
Copy link
Contributor

The API has been fixed topcoder-platform/challenge-api@4c93b66

Now need to do the changes from #4393 (comment)

@rootelement
Copy link
Contributor

@ThomasKranitsas please confirm you're making the changes

@ThomasKranitsas
Copy link
Contributor

@sushilshinde @rootelement I'm trying to fix this one but it's not working as expected. Feel free to get another developer to look into this if you want and if he can fix it first, he can get paid but I'll still be looking into this

@crazyk07
Copy link

crazyk07 commented Jun 2, 2020

Contest https://www.topcoder.com/challenges/30127673 has been created for this ticket.

This is an automated message for crazyk via Topcoder X

@crazyk07
Copy link

crazyk07 commented Jun 2, 2020

Contest https://www.topcoder.com/challenges/30127673 has been updated - it has been assigned to luizrrodrigues.

This is an automated message for crazyk via Topcoder X

@crazyk07
Copy link

Contest https://www.topcoder.com/challenges/30127673 has been updated - it has been assigned to luizrrodrigues.

This is an automated message for crazyk via Topcoder X

@luizrrodrigues
Copy link
Collaborator

WIP PR: topcoder-platform/topcoder-react-lib#194

  • Updated group addMember() call
  • Updated auth.js to use V5 API
  • Updated reduceGroupIds to use id instead oldId

TODO: Need a API solution here, because we can't pass body in GET request: #4393 (comment)

@luizrrodrigues
Copy link
Collaborator

UPDATE:

  • Fix done in API not working, if use groups[]=xxxx looks like not filtered and API return all challenges:
https://api.topcoder-dev.com/v5/challenges?groups[]=304b042f-19f1-4d06-9788-104572eca795&groups[]=72a0b8a0-aa45-44f7-86c2-bf9de6321e5b

.

  • All challenges returning empty data in groupsfield

cc @sushilshinde @rootelement

@luizrrodrigues
Copy link
Collaborator

☝️ Was fixed.

@luizrrodrigues
Copy link
Collaborator

@sushilshinde PRs:
topcoder-platform/topcoder-react-lib#194
#4580

  • Fixed getRestActiveChallenges() to use filter
  • Updated filter.groupIds to filter.groups
  • Fix challenges filter mapToBackend()
  • Added backend filter to getRestActiveChallenges
  • Fix warning about propTypes
  • Update auth tests to support v5 API

@sushilshinde
Copy link
Collaborator

Thanks @luizrrodrigues will review and merge

@SathyaJayabal
Copy link
Collaborator Author

verified on test
Screenshot 2020-06-23 at 3 22 04 PM
Screenshot 2020-06-23 at 3 22 09 PM

@crazyk07
Copy link

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30127673

This is an automated message for crazyk via Topcoder X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants