Skip to content
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

feat: Display detailed challenge completion info in hacker page #624

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CeS-3
Copy link

@CeS-3 CeS-3 commented Nov 19, 2024

This PR adds functionality to display detailed challenge completion information in the user interface.

Purpose:
This update introduces the ability to show detailed information about the specific challenges a user has completed within each module of a dojo. It enhances the user experience by providing a clear and organized view of completed challenges along with their completion dates.

Key Changes:

  • Backend Updates:

    • Modified the view_hacker function to include detailed challenge completion data for each module and dojo.
    • Added the user_solves data structure to include completion dates for challenges in addition to their IDs.
  • Frontend Updates:

    • Updated the user interface template to display the names and completion dates of challenges under each completed module.
    • Ensured proper alignment and formatting of challenge rows for better readability.

@zardus
Copy link
Contributor

zardus commented Nov 19, 2024

We'll need to smoke test this with a production DB backup before merging. One of the reasons that the individual challenge details went away was that they were timing out the profile page. But that might actually have been because we tried to get this in a single query before, and this does a query per module, which might be more tractable? We'll have to see.

If we run into performance issues, I think the solution would be to add a global per-challenge score cache to https://github.com/pwncollege/dojo/blob/master/dojo_plugin/utils/scores.py, keep it warm in https://github.com/pwncollege/dojo/blob/master/dojo_plugin/scripts/warm_cache.py, and use that, but we can test this first before resorting to such measures.

@CeS-3
Copy link
Author

CeS-3 commented Nov 19, 2024

We'll need to smoke test this with a production DB backup before merging. One of the reasons that the individual challenge details went away was that they were timing out the profile page. But that might actually have been because we tried to get this in a single query before, and this does a query per module, which might be more tractable? We'll have to see.

If we run into performance issues, I think the solution would be to add a global per-challenge score cache to https://github.com/pwncollege/dojo/blob/master/dojo_plugin/utils/scores.py, keep it warm in https://github.com/pwncollege/dojo/blob/master/dojo_plugin/scripts/warm_cache.py, and use that, but we can test this first before resorting to such measures.

Thank you for the feedback! I look forward to the test results and am happy to proceed with the next steps if needed.

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

Successfully merging this pull request may close these issues.

2 participants