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

datasets extended metadata does not match .../datasets count #745

Closed
matthew-white opened this issue Jan 25, 2023 · 4 comments · Fixed by #762
Closed

datasets extended metadata does not match .../datasets count #745

matthew-white opened this issue Jan 25, 2023 · 4 comments · Fixed by #762
Assignees
Labels
bug entities Multiple Encounter workflows

Comments

@matthew-white
Copy link
Member

matthew-white commented Jan 25, 2023

If you request extended metadata for a project, a datasets property is returned. However, it looks like that doesn't exclude datasets from form drafts. The …/datasets endpoint does exclude those datasets, which means that the two endpoints disagree on the number of datasets. That's an issue for Frontend because Frontend uses the datasets property to decide whether to render the Datasets tab. Right now, the following sequence is possible:

  • Create a new form that creates the first dataset for the project.
  • Navigate to the project overview in a new tab (or navigate, then refresh the page). You will see the Datasets tab even though it is supposed to be hidden.
  • If you navigate to the Datasets tab, you will be immediately redirected to the homepage. That's because Frontend updates the datasets property on the project to match the number of datasets returned by .../datasets, which is 0, causing it to realize that the user shouldn't be on the page after all.

I'm not sure that every aspect of how Frontend works there is ideal, but I do think that we should try to get those two counts in sync.

@matthew-white matthew-white added bug entities Multiple Encounter workflows labels Jan 25, 2023
@github-project-automation github-project-automation bot moved this to 🕒 backlog in ODK Central Jan 25, 2023
@matthew-white
Copy link
Member Author

I'm going to slot this for 2023.2 unless we have time for it now. Presumably this has been an issue since 2022.3.

@sadiqkhoja sadiqkhoja self-assigned this Feb 7, 2023
sadiqkhoja added a commit to sadiqkhoja/central-backend that referenced this issue Feb 7, 2023
@sadiqkhoja
Copy link
Contributor

Steps to reproduce:

  • Upload a Form that creates a Dataset like tree_registration, but do not publish the form.
  • Refresh the page, you will see the Dataset tab
  • Click on Dataset tab, you will be redirected to home page

After the fix:

  • When you upload the form with Dataset, you should not see the Dataset tab until Form is not published

@sadiqkhoja sadiqkhoja moved this from 🕒 backlog to ✏️ in progress in ODK Central Feb 7, 2023
@ktuite ktuite assigned ktuite and sadiqkhoja and unassigned sadiqkhoja and ktuite Feb 7, 2023
@github-project-automation github-project-automation bot moved this from ✏️ in progress to ✅ done in ODK Central Feb 8, 2023
@dbemke
Copy link

dbemke commented Feb 22, 2023

Tested with success!

@srujner
Copy link

srujner commented Feb 22, 2023

Tested 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.

5 participants