Skip to content

[$20]Registration: Challenge terms displayed even if the user has already agreed to the terms #4548

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 Jun 17, 2020 · 28 comments

Comments

@SathyaJayabal
Copy link
Collaborator

Registration: Challenge terms displayed even if the user has already agreed to the terms. Onclicking on agree nothing happens and the user cannot proceed to register. We see the following error in the api response
https://api.topcoder.com/v2/terms/21303/agree
https://beta-community-app.topcoder.com/challenges/adb02d6f-dcc6-4fcc-b7a4-a16c7d173839
user:picachui
Screenshot 2020-06-17 at 12 04 48 PM

Another example:https://beta-community-app.topcoder.com/challenges/d3886070-f6f7-4f23-81b5-9fb7e3272c06

@sushilshinde sushilshinde changed the title Registration: Challenge terms displayed even if the user has already agreed to the terms [$50]Registration: Challenge terms displayed even if the user has already agreed to the terms Jun 17, 2020
@sushilshinde
Copy link
Collaborator

@topcoder-platform/topcodercompetitors @topcoder-platform/tcxcommunity this is open for pickup

Submit in 8 hours and PR to

https://github.com/topcoder-platform/community-app/tree/integration-v5-challenge-api
https://github.com/topcoder-platform/topcoder-react-lib/tree/integration-v5-challenge-api

run npm run test before PR

@crazyk07
Copy link

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

This is an automated message for crazyk via Topcoder X

@cagdas001 cagdas001 self-assigned this Jun 17, 2020
@crazyk07
Copy link

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

This is an automated message for crazyk via Topcoder X

@cagdas001
Copy link
Collaborator

What is the password of picachui user?

@cagdas001
Copy link
Collaborator

cagdas001 commented Jun 17, 2020

@sushilshinde @SathyaJayabal

What is the password of picachui user?

@rootelement
Copy link
Contributor

Did you try appirio123?

@SathyaJayabal
Copy link
Collaborator Author

@cagdas001 , thats my production user id. Please use your handle.

@cagdas001
Copy link
Collaborator

Did you try appirio123?

@rootelement Yes I tried it, didn't work. The issue is that, the login link redirects me to the https://accounts.topcoder.com domain while the beta domain is actually https://beta-community-app.topcoder.com

I couldn't find a login link on beta instance so can't login with appirio123

@cagdas001
Copy link
Collaborator

@cagdas001 , thats my production user id. Please use your handle.

Okay, thank you. I thought it won't prompt me the dialog with my own username since I already agreed them before, but it did. Now I can reproduce

@SathyaJayabal
Copy link
Collaborator Author

@cagdas001 , thats my production user id. Please use your handle.

Okay, thank you. I thought it won't prompt me the dialog with my own username since I already agreed them before, but it did. Now I can reproduce

Yes, thats the error. The Front end prompts even when the user is already agreed to the terms. We need to check if the user is already agreed, before displaying the prompt.

@cagdas001 cagdas001 removed their assignment Jun 17, 2020
@cagdas001
Copy link
Collaborator

Releasing as I'm currently having some issues with node-gyp on my Windows machine

@crazyk07
Copy link

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

This is an automated message for crazyk via Topcoder X

@sushilshinde
Copy link
Collaborator

@PrakashDurlabhji wait for confirmation on v5 terms API shift

@sushilshinde sushilshinde added the Need clarification Need clarification to proceed fixing the issue further label Jun 18, 2020
@PrakashDurlabhji PrakashDurlabhji removed the Need clarification Need clarification to proceed fixing the issue further label Jun 22, 2020
@PrakashDurlabhji
Copy link
Contributor

@sushilshinde shall I proceed with this?

@sushilshinde
Copy link
Collaborator

Yes use terms v5 api

@PrakashDurlabhji
Copy link
Contributor

@sushilshinde working

@PrakashDurlabhji
Copy link
Contributor

@SathyaJayabal was it ever working perfectly?

  1. I remember when agreement used to be seen by me and I register than nothing happens.
  2. then i refresh the challenge page and i am found to be registered. so is this expected flow?
  3. also can you please give some test challenges where i may not have agreed yet.

@PrakashDurlabhji
Copy link
Contributor

@sushilshinde I guess terms api not yet on V5 because this is not working

https://api.topcoder.com/v5/terms/detail/21303

Need clarification label was removed by me mistakenly.

@PrakashDurlabhji PrakashDurlabhji added the Need clarification Need clarification to proceed fixing the issue further label Jun 23, 2020
@PrakashDurlabhji
Copy link
Contributor

@SathyaJayabal @sushilshinde can anyone please raise a ticket v5 terms api migration on respective repo? Apology for removing need clarification label earlier

@SathyaJayabal
Copy link
Collaborator Author

SathyaJayabal commented Jun 23, 2020

@sushilshinde
Copy link
Collaborator

@luizrrodrigues can you also guide @PrakashDurlabhji in implementation as your issues also related.

@luizrrodrigues
Copy link
Collaborator

@PrakashDurlabhji Instead https://api.topcoder.com/v5/terms/detail/21303 you need to use https://api.topcoder-dev.com/v5/terms/b11da5cd-713f-478d-90f4-f679ef53ee95 to get details.

@sushilshinde I think this one is a duplication of #4562

Both issues need to update the terms to use V5 API.

@PrakashDurlabhji
Copy link
Contributor

PrakashDurlabhji commented Jun 23, 2020

@sushilshinde thanks.

Also I am actively trying to make a call from postman.
and yes @luizrrodrigues I just debugged and found mapping that 'v2/terms/detail/21303' is now v5/terms/{termsOfUseId}'.

@SathyaJayabal @luizrrodrigues I do not find in swagger https://github.com/topcoder-platform/terms-service/blob/dev/docs/swagger.yaml
the api to get all terms of challenge by challengeId.

  1. In prod rite now there is a call to get challenge terms
    this.private.api.get(/terms/${challengeId}?role=Submitter)

  2. and then after selecting a termuseOfid from above response we call 'v2/terms/detail/21303' in prod.

  3. so mapping of 'v2/terms/detail' is there in v5, but what about this 'v2/terms/${challengeId}?role=Submitter'?

I am stuck here

@PrakashDurlabhji
Copy link
Contributor

@SathyaJayabal @sushilshinde @luizrrodrigues

Though I feel its not correct usage of api, I am bit confused.

  1. I just tried in POSTMAN https://api.topcoder.com/v5/terms?legacyId=30130750
    and passed tokenV3 in authorization .
  2. It says "You are not allowed to perform this action".

I feel everything is smooth for terms details but not for getting all terms of a challenge.

@PrakashDurlabhji
Copy link
Contributor

@SathyaJayabal waiting for endpoint

just for note down: http://localhost:3000/challenges/847bc43a-53c1-4cdd-a2ac-d3a7eb5ee25c

@rootelement
Copy link
Contributor

You need to use the array of terms on the challenge response, then call the terms api for details. Right now there's no multi-id filter, so you'll have to hit it for each. The order of operations here should be:

  1. Filter the challenge's terms on roleId for submitter
  2. Loop through those terms IDs calling the terms api

This is similar to how it's done in the resources api:

https://github.com/topcoder-platform/resources-api/blob/b5c242e00bdfab55a49ba2d4e25d7a23dacd2aa7/src/services/ResourceService.js#L158

https://github.com/topcoder-platform/resources-api/blob/cfa7b62938fbf6daee4a44ad3a745566fcc08ba7/src/common/helper.js#L430

@luizrrodrigues
Copy link
Collaborator

@PrakashDurlabhji Please check about duplication with @sushilshinde
I'm already implementing this in issue #4562

@sushilshinde sushilshinde changed the title [$50]Registration: Challenge terms displayed even if the user has already agreed to the terms [$25]Registration: Challenge terms displayed even if the user has already agreed to the terms Jun 24, 2020
@sushilshinde sushilshinde changed the title [$25]Registration: Challenge terms displayed even if the user has already agreed to the terms [$20]Registration: Challenge terms displayed even if the user has already agreed to the terms Jun 24, 2020
@crazyk07
Copy link

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

This is an automated message for crazyk via Topcoder X

@lakshmiathreya lakshmiathreya added CF Retested and removed tcx_Assigned Need clarification Need clarification to proceed fixing the issue further labels Aug 13, 2020
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

8 participants