radiantearth / stac-browser

A full-fledged UI in Vue for browsing and searching static STAC catalogs and STAC APIs
https://radiantearth.github.io/stac-browser
ISC License
282 stars 140 forks source link

List of items in the browse menu are not loading anymore #344

Open chiarch84 opened 1 year ago

chiarch84 commented 1 year ago

We deployed the current stable version of STAC browser and the items are not loading in the browse menu even if correctly returned by the GET call.

image

m-mohr commented 1 year ago

Thanks for the report. Can you please check whether it works in https://radiantearth.github.io/stac-browser for your instance?

chiarch84 commented 1 year ago

Well our instance is under authentication so I cannot load it there. But if you want to test it you can register for an EU-Login and try it: https://jeodpp.jrc.ec.europa.eu/eu/data/stac-browser/#/

m-mohr commented 1 year ago

In this case, I'd like to ask for the following:

  1. Which version did you update from? 3.0.0 or 3.0.1 to 3.0.2?
  2. Can you run the main branch locally and try whether it works for you? The issue is that I can't replicate your issue, it works for example for Planetary Computer.
  3. Do any errors appear in the Browser console when the issue occurs?
chiarch84 commented 1 year ago

1) I have the same error for version 3.0.2 and 3.0.0-rc.1. I don't remember the precise version in which it was working since it has been some time now that we've got this error but I failed to report it. 2) I think we tried it last week and had the same problem but can retry . I'll report it to you. 3) No errors in the console and all the calls to get the items are correctly performed and return the correct number of items.

Just to be sure, did you change something from the original 3.0.0 dev branch on for searching items?

m-mohr commented 1 year ago

So is this a potential regression of #231 ?

Search has received updates over time, yes.

chiarch84 commented 1 year ago

Yes it seems a regression of that. I don't remember if I tested right after your workaround. For sure it has been some months now that it's not working anymore.

In the previous post I meant if the ways of retrieving items from the APIs has changed over time, e.g. if you're looking for new parameters or for children instead of items. I'm just guessing if this could be the problem or if it's probably again a problem of listener.

m-mohr commented 1 year ago

Yeah, there have been changes over time. The biggest issue right now is that I can't reproduce it with any of the public instances. I can't login with the EU login right now.

iliion commented 7 months ago

FYI. In this working example when clicking on a collection from the sidebar (in this case cgls_landcover) the following request is performed -> https://explorer.digitalearth.africa/stac/collections/cgls_landcover/items?limit=12. That request is redirected (302) to https://explorer.digitalearth.africa/stac/search?collection=cgls_landcover&limit=12

image

Is this the correct funcionality?

m-mohr commented 7 months ago

This has nothing to do with STAC Browser, that seems like a server-specific behavior.

chiarch84 commented 7 months ago

And do you think the field context.page = 0 would make the difference to make this browsing work? Since I'm trying to find differences between our STAC Browser and this example where it works, and cannot find any differences a part from this field which we currently don't return.

m-mohr commented 7 months ago

The context extension is not used by the sidebar. I assume it's still some kind of race condition, but it's hard to reproduce and fix.

itrnd commented 4 months ago

@m-mohr I've managed to reproduce this using latest revision on main branch. The issue seems to be related to apiCatalogPriority config option. Using catalog https://explorer.digitalearth.africa/stac/ I ran locally two instances of stac-browser with apiCatalogPriority='childs' and apiCatalogPriority=null(default), respectively.

  1. docker run -p 20011:8080 -e SB_catalogUrl="https://explorer.digitalearth.africa/stac/" -e SB_apiCatalogPriority="childs" stac-browser:v1
  2. docker run -p 20012:8080 -e SB_catalogUrl="https://explorer.digitalearth.africa/stac/" stac-browser:v1

On the first instance (apiCatalogPriority='childs') the issue is reproducible. For instance, expanding catalog "cci_landcover" would load only the sub-catalogs tree (cci_landcover-\<YYYY>-1) but not the directly linked items. While on the second instance the full tree was loaded with both sub-catalogs and directly linked items. I reverted the priority related changes on src/models/stac.js:STAC.getChildren() from the commit that introduced apiCatalogPriority and the issue seemed gone, full tree was loaded as expected. Hope this helps.

m-mohr commented 4 months ago

Thank you for the evaluation @itrnd. I believe, after my first evaluations last year, that the issue is related to loading from API endpoints in general and the fact that due to race conditions sometimes the data in the background gets overridden/erased. The prio option may only hide the behavior in some cases. Nevertheless it's good to have this documented for when someone starts to fix this.