Skip to content

Site: Improve challenge transfer edge cases #740

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ConnorNelson
Copy link
Member

Challenge transfer logic has some interesting edge cases, this PR seeks to clarify them a bit.

In particular, the edge case that led to this PR is the case where someone creates a challenge, then realizes what they actually wanted to do was transfer a challenge. Under the current logic, the transfer will not happen because the challenge already exists, and so it will never enter the transfer logic. Transfer logic should take priority.

However, if there is an existing challenge, we have to be careful, and have some options:

  • Refuse and throw an error
  • Orphan the existing challenge (this gets complicated fast)
  • Delete the existing challenge
  • Delete the existing challenge, but only if there are no solves, otherwise refuse and throw an error
  • Merge the challenges (e.g., the solves)

For now, we will just refuse and throw an error.

@ConnorNelson
Copy link
Member Author

Probably long-term what we need is to separate this sort of capability out of the yml. The yml should only define all the challenges, descriptions, order of them, etc. It should not depend on / more seriously interact with the state of a particular deployment of the dojo.

Instead, state management like this should happen either directly on the site, or using some dojo command(s) while in the infrastructure, whether it is renaming an id, or deleting solves, or merging solves of two challenges together into one challenge, etc.

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.

1 participant