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

Warn about forms with old version of entity spec <2024.* #730

Closed
ktuite opened this issue Oct 2, 2024 · 9 comments · Fixed by getodk/central-backend#1272
Closed

Warn about forms with old version of entity spec <2024.* #730

ktuite opened this issue Oct 2, 2024 · 9 comments · Fixed by getodk/central-backend#1272
Assignees
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified entities Multiple Encounter workflows frontend Requires a change to the UI

Comments

@ktuite
Copy link
Member

ktuite commented Oct 2, 2024

When we migrate the entity form spec in existing entity forms we will not want to accept want to warn about new forms with an old entity spec.

From the above issue:

Once forms are migrated, we will need to check going forward that all form definitions that are uploaded (for new or existing forms) are capable of making offline changes. Specifically, we should reject form definitions that specify an entities spec before 2024.1. That shouldn't be an issue for users using XLSForms (things should work seamlessly), because pyxform will automatically specify 2024.1.

UPDATE: The issue mentioned rejecting form definitions, but we've decided to show a warning about them instead.

One hurdle users might encounter is if they have an old version of their form in XML and it has an old entity spec version. In that case, we can give users info on how to recover (e.g. download upgraded XML, look at spec to figure out changes to apply).

@ktuite ktuite added backend Requires a change to the API server documentation API docs, readme, developer docs entities Multiple Encounter workflows labels Oct 2, 2024
@ktuite ktuite moved this to 🕒 backlog in ODK Central Oct 2, 2024
@ktuite ktuite self-assigned this Oct 2, 2024
@matthew-white matthew-white added the needs testing Needs manual testing label Oct 2, 2024
@matthew-white matthew-white added frontend Requires a change to the UI and removed documentation API docs, readme, developer docs labels Oct 24, 2024
@matthew-white matthew-white changed the title Reject forms with old version of entity spec <2024.* Warn about forms with old version of entity spec <2024.* Oct 24, 2024
@matthew-white
Copy link
Member

We've discussed that it'd be nice not to outright reject forms like this if doing so is not necessary. Instead, we can warn users if the form definition they've uploaded specifies an old spec. I'll update the description above.

Surfacing the warning in Frontend will probably require changes to Frontend. I've added the frontend label to the issue.

I've also removed the documentation label, since it isn't a docs issue. There's an issue at getodk/docs#1855 to update user docs, and an issue at getodk/central-backend#1211 to update API docs. Feel free to edit those!

@dbemke
Copy link

dbemke commented Nov 28, 2024

I'm not sure if this case works as expected - when I upload an old spec entity form which exists in the project first there's the dialog with information about the old spec (I tap "Upload anyway") and then the dialog with information that the form exists in a project appears. Should the dialog informing that the form already exists in the project be the first (and only) one?
Image
Image

Steps to reproduce:

  1. Upload an old spec entity form and publish it.
  2. Try to add the same form again.
  3. The dialog with information about the spec appears, tap "Upload anyway"

@dbemke
Copy link

dbemke commented Nov 28, 2024

Should the warning about the old spec appear only when a user adds a new or also when adds a new version of a form (e.g changing the new spec to the old spec), undeletes the old spec form?

@ktuite
Copy link
Member Author

ktuite commented Dec 2, 2024

It probably should warn when they upload a new version. (And it probably doesn't do that right now, does it? I can add that!)

Should the warning about the old spec appear only when a user adds a new or also when adds a new version of a form (e.g changing the new spec to the old spec), undeletes the old spec form?

Hmm, I see what you're saying with these two phases of dialog boxes. Knowing how it works under the hood, there isn't really a way to do something different. The first one about the version is a warning and the second is an error even though they are about different things.

I'm not sure if this case works as expected - when I upload an old spec entity form which exists in the project first there's the dialog with information about the old spec (I tap "Upload anyway") and then the dialog with information that the form exists in a project appears. Should the dialog informing that the form already exists in the project be the first (and only) one?

@dbemke
Copy link

dbemke commented Dec 3, 2024

It probably should warn when they upload a new version. (And it probably doesn't do that right now, does it? I can add that!)

The warning doesn't appear when a new version of a form is uploaded.
We finished testing. Should we wait for changes with the warning while adding a new version or is it going to be a separate issue?

@ktuite
Copy link
Member Author

ktuite commented Dec 3, 2024

I've created a new issue! #816

The warning doesn't appear when a new version of a form is uploaded. We finished testing. Should we wait for changes with the warning while adding a new version or is it going to be a separate issue?

@ktuite
Copy link
Member Author

ktuite commented Dec 3, 2024

Actually, we've decided to close the new #816 issue -- it requires too much of a code change to justify. You can evaluate this issue with just the functionality for new forms. Thanks!

@dbemke
Copy link

dbemke commented Dec 4, 2024

Tested with success!

1 similar comment
@WKobus
Copy link

WKobus commented Dec 4, 2024

Tested with success!

@WKobus WKobus added behavior verified Behavior has been manually verified and removed needs testing Needs manual testing labels Dec 4, 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 frontend Requires a change to the UI
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

4 participants