JJ-8 / CTFNote

CTFNote is a collaborative tool aiming to help CTF teams to organise their work. This tool helps making notes during CTFs, so you can track your CTF notes at a later time. This is similar to the CTF pad seen in one of the video's of Liveoverflow.
GNU General Public License v3.0
9 stars 2 forks source link

Update CTF end date if before start date #31

Closed XeR closed 1 year ago

XeR commented 1 year ago

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.