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

Names of datasets are case-sensitive #627

Closed
dbemke opened this issue Apr 9, 2024 · 6 comments · Fixed by getodk/central-backend#1127
Closed

Names of datasets are case-sensitive #627

dbemke opened this issue Apr 9, 2024 · 6 comments · Fixed by getodk/central-backend#1127
Assignees
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified entities Multiple Encounter workflows

Comments

@dbemke
Copy link

dbemke commented Apr 9, 2024

Problem description

Names of datasets are case-sensitive. It's possible to create a dataset e.g. "abc" and "Abc".

Steps to reproduce the problem

  1. Go to Entity Lists page.
  2. Click "+New”.
  3. Enter "abc” and click "Create”.
  4. Click "+New”.
  5. Enter "Abc” and click "Create”.

Screenshot

SameDatasetCapital

Expected behavior

Names of datasets should be case-insensitive.

Central version shown in version.txt

https://staging.getodk.cloud/#/
versions:
f0b2a90 (v2023.5.1-5-gf0b2a90)
+2bb17a501416814bbd987ddc953abc5b0c40c58a client (v2023.5.0-43-g2bb17a50)
+267e0ad7806057fc82894f58bea680627f1de5cd server (v2023.5.0-49-g267e0ad7)

@matthew-white

This comment was marked as resolved.

@matthew-white matthew-white added backend Requires a change to the API server entities Multiple Encounter workflows labels Apr 9, 2024
@github-project-automation github-project-automation bot moved this to 🕒 backlog in ODK Central Apr 9, 2024
@matthew-white matthew-white added the needs testing Needs manual testing label Apr 9, 2024
@matthew-white
Copy link
Member

I just checked, and it does look like it's possible to create two datasets like this by publishing forms: https://staging.getodk.cloud/#/projects/84. We'd like to address that as part of this issue as well: there should be no way to create two datasets like this.

@ktuite
Copy link
Member

ktuite commented Apr 16, 2024

When entities just came from forms, it was okay if form A wrote to dataset "trees" and then form B also wrote to dataset "trees". We didn't check for dataset name collisions and this (combined with not altering the casing of the name) is what is leading to it being possible to create both "trees" and "TREES" as separate datasets.

Just writing out what I think we want instead:

  • whichever case is created first is the true case, e.g. if "TREES" is created first, that is what any other form must use, vs. "trees".
  • there should be an error on form upload if you try to upload a form draft that defines a dataset with the same name but different case than already exists (and is published), and it tells you to change the casing to match what exists.
  • there should be an error on form publish if you make two drafts with different casing, publish the first, and then try to publish the second
  • there should be an error when trying to make a name via the API that clashes with a current dataset name

@ktuite ktuite moved this from 🕒 backlog to ✏️ in progress in ODK Central Apr 19, 2024
@ktuite
Copy link
Member

ktuite commented Apr 19, 2024

Hi @getodk/testers,

I wrote in the PR that some of the places you should expect to see errors now include:

  • Error on Form Upload if dataset name (e.g. "TREES") conflicts with a published dataset ("trees")
  • Error on Form Publish if publishing will introduce a conflict, which can happen if there were multiple draft forms with different name variations ("TREES" and "trees"), one was published ("trees"), and then a second is attempted to be published ("TREES").
  • Error on "New Entity List" / API if dataset name conflicts with a published dataset
    • Now allowed to create/publish a dataset that directly collides with an unpublished dataset

Some things you are allowed to do:

  • Upload unpublished forms with different capitalization variations of the same dataset. The first one to be published is the one that is locked in.
  • Create a form that makes a draft dataset like "trees", and then use the "New Entity List" button to create/publish "trees". Then publishing the form wont publish the dataset because it will already have been published.
    • Similarly, you could probably make two draft forms "trees" and "TREES" and then use the New Entity List button to make a dataset with the name "TrEes", an then block the publishing of both forms.

I have a lot of different tests for different situations, but please play around and see if you find any other weird edge cases!

@github-project-automation github-project-automation bot moved this from ✏️ in progress to ✅ done in ODK Central Apr 20, 2024
@dbemke
Copy link
Author

dbemke commented Apr 22, 2024

Tested with success!

@srujner
Copy link

srujner commented Apr 22, 2024

Tested with success!

@srujner srujner added behavior verified Behavior has been manually verified and removed needs testing Needs manual testing labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified entities Multiple Encounter workflows
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

4 participants