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

first proposal on Auto-Delete exercises #939

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

anonym-HPI
Copy link
Contributor

@anonym-HPI anonym-HPI commented May 5, 2023

PR Checklist

Please make sure to fulfil the following conditions before marking this PR ready for review:

  • If this PR adds or changes features or fixes bugs, this has been added to the changelog
  • If this PR adds new actions or other ways to alter the state, test scenarios have been added

@anonym-HPI anonym-HPI linked an issue May 5, 2023 that may be closed by this pull request
@anonym-HPI
Copy link
Contributor Author

@Dassderdie @ClFeSc What do you think of this way to implement this?

The discussion before is also here: #183

@Dassderdie You wrote about setTimeout, I did use it in some kind (used the existing PeriodicEventHandler), this way the server could be set to like interval over every exercise like once a day and delete exercises that have not been accessed in a while.

Also the question is how often the sinceExerciseWithoutClients should be updated (only when no client is connected anymore or every minute if at least one client is connected, of course it should be renamed then).

@anonym-HPI
Copy link
Contributor Author

anonym-HPI commented May 10, 2023

If somebody wants to help write a test.
A test should do the following

  1. Create a new exercise
  2. Let a client connect to it
  3. Disconnect this client
  4. Wait at least Config.cleanupTime (maybe a bit more, to be sure)
  5. Then try to connect again to this exercise
  6. Expect that an error is returned that the exercise does not exist anymore

Another test could be:

  1. An exercise is importet (without any client connecting to the exercise)
  2. Follow step 4-6 above

Another test could be to check that an exercise is not deleted when CleanupEnabled === false

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.

Auto-Delete exercises for privacy reasons
1 participant