dandi / dandiarchive-legacy

Code for the DANDI Web app
https://dandiarchive.org
Apache License 2.0
9 stars 9 forks source link

Dandiset page not loading intermittently #963

Closed dchiquito closed 3 years ago

dchiquito commented 3 years ago

While spamming refresh on a staging dandiset page, I encountered this error: image I think it's a race condition that prevents the entire dandiset page from loading.

dchiquito commented 3 years ago

It does indeed seem to be a race condition. App.vue triggers the fetchSchema action, which downloads the schema asynchronously. DandisetLandingView is the only place where that schema is accessed, but it passes the schema as a prop to both DandisetMain and Meditor, where they assume that it is a non-null object.

We could either properly null-check the schema wherever it is consumed (difficult, since the whole page basically just can't be rendered without it) or we could include the schema fetch in main.ts as a prerequesite for loading the app. We already require loadUser to fully execute before the app loads, so we could just tack the schema in there as well in a Promise.all([...]), at the cost of a slightly longer page load time.

waxlamp commented 3 years ago

It's a race condition in that sometimes DandisetMain loads before the fetch completes?