-
Notifications
You must be signed in to change notification settings - Fork 61
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
Force CTF end time to be equal or after start time #213
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now the form can't be submitted before this is fixed. This is also enforced by the database. Credits to DU4L#52
JJ-8
added a commit
to JJ-8/CTFNote
that referenced
this pull request
May 5, 2023
The implementation is mostly based on DU4L#16 but we update the timer in the database instead of the frontend. The update is done when the user fetches the profile, so for every first load done in a new tab in the browser. Please note that this commit can NOT be merged before TFNS#213 is merged since the migration files are now not consecutive. The other PR contains a migration with ID 41, so this PR has a migration with ID 42 (and this answers everything of course). The migration will fail in this branch therefore. For testing, please rename the file and use a throw away database.
This was referenced May 5, 2023
Closed
Without this fix, CTFNote will crash in the unlikely event that an invalid CTF exists: ``` /app/node_modules/postgres-migrations/dist/migrate.js:100 const error = new Error(`Migration failed. Reason: ${e.message}`); ^ Error: Migration failed. Reason: An error occurred running 'illegal-dates'. Rolled back this migration. No further migrations were run. Reason: check constraint "no_illegal_end_time" of relation "ctf" is violated by some row at /app/node_modules/postgres-migrations/dist/migrate.js:100:27 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28 at async /app/node_modules/postgres-migrations/dist/with-connection.js:16:28 { cause: Error: An error occurred running 'illegal-dates'. Rolled back this migration. No further migrations were run. Reason: check constraint "no_illegal_end_time" of relation "ctf" is violated by some row at /app/node_modules/postgres-migrations/dist/run-migration.js:36:15 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async /app/node_modules/postgres-migrations/dist/migrate.js:91:32 at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28 at async /app/node_modules/postgres-migrations/dist/with-connection.js:16:28 } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ```
See JJ-8#31 I tried to push my commit on your branch, but it looks like you locked this branch.
|
Update CTF end date if before start date
@XeR, good catch! Your commit is added to the branch. |
XeR
approved these changes
May 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now the form can't be submitted before this is fixed. This is also enforced by the database.
Credits to DU4L#52