gbv / cocoda

A web-based tool for creating mappings between knowledge organization systems.
https://coli-conc.gbv.de/cocoda/
MIT License
39 stars 5 forks source link

Don't defer loading because one registry hangs #621

Closed stefandesu closed 2 years ago

stefandesu commented 3 years ago

Currently, there seems to be an issue with the ZBW Skosmos instance that is used for STW. Loading its vocabulary data from https://zbw.eu/beta/skosmos/rest/v1/stw/?lang=en simply hangs and causes Cocoda to defer the initial load until the 20 second timeout is over.

Ideally, scheme data would continue to be loaded in the background and Cocoda should be pretty much immediately usable. However, this requires many other changes because currently Cocoda expects all concept schemes to be available.

Maybe wait until we do #583 with a big refactor...

stefandesu commented 2 years ago

The one big problem is this: What do we do if the application has a certain state in the URL parameters (selected scheme/concept and/or a mapping) and we need a certain scheme in order to load the data for that state? We don't know which registries will provide which schemes, so this seems like a problem which we can't solve.

Maybe it's enough for now to reduce the timeout for loading schemes (somewhere between 5 and 10 seconds?) and also offer a way for users to try to reload failed requests later. I'll need to think about this further.

stefandesu commented 2 years ago

For now, I've reduced the timeout for loading schemes to 10 seconds. I would like to improve this further though, for example by showing a message to the user and allowing for retries.

What do we do if the application has a certain state in the URL parameters (selected scheme/concept and/or a mapping) and we need a certain scheme in order to load the data for that state?

One idea would be to retry loading previously failed concepts when new schemes are available. Then we could, for example, reduce the timeout even further (let's say to 3-5 seconds) and later retry those registries in the background where loading took longer. As soon as schemes are loaded, the concept data which previously couldn't be loaded can then be tried again.

stefandesu commented 2 years ago

Since #670, this is less of a problem with the default configuration since we're only waiting for BARTOC, but not for other APIs. I'd say we can close this for now.