Skip to content

Non task challenge is also not returned with task challenge #276

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
vikasrohit opened this issue Aug 24, 2020 · 7 comments
Closed

Non task challenge is also not returned with task challenge #276

vikasrohit opened this issue Aug 24, 2020 · 7 comments
Assignees

Comments

@vikasrohit
Copy link

@rootelement I think we don't yet support listing tasks (which are not assigned to the user) for a non admin user, however, I think the current logic is causing non task challenges to to missing from the response as well for non admin users. We have user pshah_manager who is not able to see tasks and challenge which were created using the same account. This user is not an admin but it did create few challenges some of which are tasks (few assigned to other users and few unassigned).

@vikasrohit
Copy link
Author

vikasrohit commented Aug 24, 2020

@rootelement @ThomasKranitsas suggested a fix #277. I tried the query in postman by directly calling the ES endpoint but not tested the code itself. Further, I am not sure if it creates issue with any other use case e.g. public challenge listings or not.
Please feel free to discard it, if it is already thought upon and we know it is causing some regression.

@rootelement
Copy link
Contributor

@vikasrohit I've merged the PR to dev. Please test there. If it looks good to you, we can have the QA team test as well.

@ThomasKranitsas
Copy link
Contributor

@rootelement I think I found the issue.

If you check this https://api.topcoder-dev.com/v5/challenges/b91e4c01-ec46-404f-8691-aa631776d0e5

It has:

task: {
   isTask: true
},

Note that the isAssigned and memberId properties are missing and since the query is trying to match with { match_phrase: { 'task.isAssigned': false } }, it fails.
If that's actually the reason, we can simply fix it by adding default values to those fields (false and null respectively)

@ThomasKranitsas ThomasKranitsas self-assigned this Aug 26, 2020
@rootelement
Copy link
Contributor

@ThomasKranitsas is it better to add default values, or check for false OR non-existent?

@ThomasKranitsas
Copy link
Contributor

I'd say better to add default values.. No need to over-complicate the query as that could have a performance impact

@ThomasKranitsas
Copy link
Contributor

@rootelement should I fix this?

@rootelement
Copy link
Contributor

Fixed in #292

@rootelement rootelement added this to the v1.0.2 Release milestone Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants