NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
41 stars 26 forks source link

Profile page gives incorrect results with POST query #2073

Open robyngit opened 1 year ago

robyngit commented 1 year ago

Describe the bug When the App Config disableQueryPOSTs option is false, queries are sent using POST instead of GET. Using POST requests somehow results in profile pages displaying incorrect results (no datasets in the cases I've found so far). When query requests are sent with GET instead (i.e. disableQueryPOSTs is true), then different (and presumably correct) results are shown.

Example 1: Jeanette's profile on the ADC

Case 1A: disableQueryPOSTs:false Screen Shot 2022-11-08 at 13 11 58

Case 1B: disableQueryPOSTs:true Screen Shot 2022-11-08 at 13 12 34

Example 2: Matt's profile on the KNB

Case 2A: disableQueryPOSTs:false Screen Shot 2022-11-08 at 13 30 51

Case 2B: disableQueryPOSTs:true Screen Shot 2022-11-08 at 13 31 07

The bug does not occur on profiles for people who aren't part of a lot of groups (e.g. Jasmine's profile http://localhost:3000/profile/http://orcid.org/0000-0001-8888-547X). This is because for shorter queries, MetacatUI always uses GET.

To Reproduce Steps to reproduce the behavior:

Running MetacatUI locally:

  1. In the config file, set disableQueryPOSTs to true
  2. Go to the profile for a person who is part of a lot of groups (~10 or more) and has contributed to at least one dataset, e.g. Matt's http://localhost:3000/profile/http://orcid.org/0000-0003-0077-4738. See a list of datasets for that person.
  3. In the config file, set disableQueryPOSTs to false
  4. Go back to the same profile as in step number 2, see that no datasets are listed.

In Production:

At the time of writing, search.dataone.org disables query POSTs, but KNB & ADC do not. So you can currently see this behaviour by navigating to the same profile on search.dataone.org and comparing it to the profile on the ADC or KNB. For example, see Matt's profile on DataONE vs Matt's profile on KNB.

Expected behavior Correct results should be displayed whether the query is done using GET or POST

Additional context Found while investigating #2042. The POST queries were implemented in #392. We should fix this before implementing #1998

jeanetteclark commented 1 year ago

I had been wondering why my profile page changed