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

MetricOverviewContainer dataFetch is not rejected when metric data is not found #313

Open
openjck opened this issue Mar 13, 2019 · 1 comment

Comments

@openjck
Copy link
Contributor

openjck commented Mar 13, 2019

Because this is a single-page app, even paths which are not found return a 200. For example:

https://data.firefox.com/datasets/desktop/user-activity/Worldwide/nonExistentMetric

When react-refetch tries to fetch a page like this, the dataFetch gets stuck in pending forever, so no error message is ever shown. Switching to a server-side framework like Next.js (#142) would probably solve this. Alternatively, we could host data from a different domain which does return 404s for non-existent paths.

@openjck openjck changed the title MetricOverviewContainer dataFetch is never rejected, even when there are problems loading the metric MetricOverviewContainer dataFetch is not rejected when metric data is not found Mar 13, 2019
@openjck
Copy link
Contributor Author

openjck commented Mar 13, 2019

Here's the code in question:

// Due to the way ensemble is currently hosted, this code is not run
// when metric data is not found.
//
// https://github.com/mozilla/ensemble/issues/313
} else if (dataFetch.rejected) {
if (dataFetch.reason && dataFetch.reason.message) {
// eslint-disable-next-line no-console
console.error(dataFetch.reason.message);
}
return (
<ErrorComponent
id="metric-overview-fetch-error"
title="Error fetching metric"
/>
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant