topcoder-platform / work-manager

This is the frontend application for creating and managing challenges.
13 stars 48 forks source link

Work Manager not showing copilot for Topcoder-X tickets #1141

Open jmgasper opened 3 years ago

jmgasper commented 3 years ago

Expected behavior

A challenge created by Topcoder-X should show the assigned copilot that is assigned via the resources API

Actual behavior

The copilot isn't shown for challenges created via TC-X.

A few notes:

Example:

https://www.topcoder-dev.com/challenges/6b5f5af8-70ea-459d-8591-ef554aff1359

Steps to reproduce the problem

Screenshot/screencast

Screen_Shot_2021-04-27_at_10_10_24_am
ThomasKranitsas commented 3 years ago

This is an issue with the frontend. I tested and the API does return all resources correctly.

ThomasKranitsas commented 3 years ago

maybe the frontend is doing a currentUser.userId === challenge.createdBy kind of check which fails and it assumes the user does not have access?

ThomasKranitsas commented 3 years ago

You can also see in the network tab that all resources are being returned by the API

Screenshot 2021-04-30 at 11 52 02 PM
jmgasper commented 3 years ago

@ThomasKranitsas - I think if the check of currentUser.userId === challenge.createdBy failed, I wouldn't be able to edit it as a manager, but I can? Seems strange that only the copilot field is affected.

vikasrohit commented 3 years ago

@jmgasper is that task is deleted now? v5 api is returning on 404 to me.

@ThomasKranitsas I don't we are doing any thing like currentUser.userId === challenge.createdBy. And the resource record that you shown in your screenshot does not have the copilot role id, in dev and prod both, the copilot role id is cfe12b3f-xxxx-xxxx-xxxx-ec86726f76bd. Front end just looks for the role id for the Copilot role by matching its name and once we have the role id, it just tries to locate the corresponding challenge resources array. So, my investigation says, if we don't get the copilot role returned for a logged user via the v5 resource api, WM won't be able to show the copilot of the challenge to that user. And I have already shared the same with some proofs in our Slack channel @ThomasKranitsas . Let me know if I can do any further investigation to help you guys out here.

jmgasper commented 3 years ago

@vikasrohit - Note that this task was created in dev: 6b5f5af8-70ea-459d-8591-ef554aff1359 is the UUID

ThomasKranitsas commented 3 years ago

@vikasrohit has anything changed on the WM? I just opened the exact same challenge and everything shows up fine.. ¯_(ツ)_/¯

jmgasper commented 3 years ago

@ThomasKranitsas - https://challenges.topcoder-dev.com/projects/17090/challenges/6b5f5af8-70ea-459d-8591-ef554aff1359/view ?

I still see copilot as empty.

Screen Shot 2021-05-04 at 9 49 48 am
jmgasper commented 3 years ago

I'm logged in as TonyJ

vikasrohit commented 3 years ago

Thanks @jmgasper for pointing it out, I was extra cautious about noticing the env, but somehow I missed that you were also referring the dev env.

@vikasrohit has anything changed on the WM? I just opened the exact same challenge and everything shows up fine..

@ThomasKranitsas no change since last release a month ago. Also, when I am trying to load the @jmgasper's task it is not returning me the copilot resource (I am not part of the challenge or project at all). Same might be happening for you @jmgasper when you are logged in as TonyJ.