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

Import UUID check: Handle empty UUID #2165

Open
MrSerth opened this issue Feb 25, 2024 · 0 comments
Open

Import UUID check: Handle empty UUID #2165

MrSerth opened this issue Feb 25, 2024 · 0 comments
Labels
bug ruby Pull requests that update Ruby code

Comments

@MrSerth
Copy link
Member

MrSerth commented Feb 25, 2024

Currently, it is possible to export / check for an exercise without any UUID. While this works technically, the resulting check (and message) are not working as intended.

Consider the following example:

  • I have a new task on CodeOcean
  • That task has never been exported before, so that the UUID attribute is null
  • Now, I click on export, which will check the UUID through our /import_uuid_check route. Resulting is a query:
    SELECT "exercises".* FROM "exercises" WHERE "exercises"."uuid" IS NULL LIMIT 1
    As you can image, this will find any other task that has not been exported before (UUID is null). Hence, the resulting message is misleading:

    A corresponding task has been found on CodeHarbor. You can export the exercise to transfer all changes made on CodeOcean to CodeHarbor. Careful: This will overwrite all potential changes made on CodeHarbor.

We should correct this behavior. Potentially, there are two solutions:

  1. Do not check for a specific exercise if the current one has no UUID (because we cannot overwrite it anyway). However, the check currently also provides information on the access token's validity, which we might still want to validate.
  2. Catch that special case on the other side, and always return that no existing exercise was found.

These two checks should be checked / implemented in CodeOcean and CodeHarbor. I just experienced it in an CodeOcean-only scenario (with two CodeOcean instances connected to each other), but can imagine that it might be valid for CodeHarbor as well.

Bildschirmfoto 2024-02-25 um 17 52 15
@MrSerth MrSerth added bug ruby Pull requests that update Ruby code labels Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ruby Pull requests that update Ruby code
Projects
None yet
Development

No branches or pull requests

1 participant