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

Link to entity list button sometimes not shown on form attachments #916

Closed
ktuite opened this issue Dec 13, 2023 · 3 comments · Fixed by #921
Closed

Link to entity list button sometimes not shown on form attachments #916

ktuite opened this issue Dec 13, 2023 · 3 comments · Fixed by #921
Assignees
Labels
bug entities Multiple Encounter workflows

Comments

@ktuite
Copy link
Member

ktuite commented Dec 13, 2023

See this comment for a description of the issue.

The form attachment page loads a list of datasets and decides whether to show a "Link this to existing Entity List" button, but in the case where a form was JUST published and just created a new dataset, the link button sometimes doesn't appear.

I thought I was seeing it in the 0->1 dataset count case, but I couldn't reproduce it. I can consistently recreate this error in the n->n+1 dataset case, though.

@ktuite ktuite moved this to 🕒 backlog in ODK Central Dec 13, 2023
@ktuite ktuite self-assigned this Dec 13, 2023
@matthew-white matthew-white added the entities Multiple Encounter workflows label Dec 13, 2023
@ktuite ktuite removed their assignment Dec 13, 2023
@matthew-white matthew-white self-assigned this Dec 15, 2023
@matthew-white matthew-white moved this from 🕒 backlog to ✏️ in progress in ODK Central Dec 15, 2023
@github-project-automation github-project-automation bot moved this from ✏️ in progress to ✅ done in ODK Central Dec 18, 2023
@matthew-white
Copy link
Member

@getodk/testers, this issue is now ready to be verified (on either staging or test.getodk.cloud).

I think this is an existing bug in production. Even though it surfaced in getodk/central#554, I think this bug exists independently of that issue.

The issue is that the Form Attachments page requests entity lists in order to determine which attachments can be linked to an entity list. However, when the form draft is published, that can publish a new entity list. And if you create a new form draft, then navigate back to the Form Attachments page, the page won't re-request the entity lists. In other words, the Form Attachments page ends up using stale data: it will continue to know about the previous entity lists, but it won't know about the newly published entity list.

I thought I was seeing it in the 0->1 dataset count case, but I couldn't reproduce it. I can consistently recreate this error in the n->n+1 dataset case, though.

I'm seeing the same thing. In the 0→1 case, where the project's first entity list is published, there shouldn't be an issue. That's because if the project doesn't already have an entity list, the Form Attachments page won't even request the entity lists, so there won't be data to become out-of-date later.

Also, even without the fix, there are ways that the stale data could become updated. In production, if you refresh the page, or if you navigate away from the form (to the project, to the homepage, etc.), then if you navigate back to the Form Attachments page for the form, you should see the "Link Entity List" button as expected.

Steps to reproduce:

  • Create a new project.
  • Create a draft form by uploading a form definition that both uses and modifies entities (say, the trees_update form).
  • Navigate to the Form Attachments page. Upload a CSV file for the attachment that has the name of the entity list that is about to be published.
  • Publish the form.
  • Create a new form draft.
  • Navigate to the Form Attachments page.
  • Observe that there is a "Link Entity List" button for the attachment. ✅
  • Navigate to the project overview.
  • Create a new draft form that again both uses and modifies entities. This time, use a new, different entity list (not the existing entity list).
  • Navigate to the Form Attachments page for the new draft form. Upload a CSV file for the attachment that has the name of the entity list that is about to be published.
  • Publish the form.
  • Create a new form draft.
  • Navigate to the Form Attachments page.
  • Observe that there is no "Link Entity List" button for the attachment. ❌

@srujner
Copy link

srujner commented Dec 18, 2023

Tested with Success!

@dbemke
Copy link

dbemke commented Dec 18, 2023

Testes with success!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug entities Multiple Encounter workflows
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

4 participants