onaio / reveal-frontend

WebUI for the Reveal epidemiological surveillance platform
8 stars 4 forks source link

IRS reporting table view breaks when there is no data from Superset #491

Closed moshthepitt closed 4 years ago

moshthepitt commented 4 years ago

As in the site completely breaks with no recourse apart from a refresh. We should handle this more gracefully. Currently happening in Zambia production.

cKellyDesign commented 4 years ago

My suspicion is that our actionCreators that we're calling should be wrapped in a conditional to only save results to stores when there are results to save.

https://github.com/onaio/reveal-frontend/blob/master/src/containers/pages/IRS/JurisdictionsReport/index.tsx#L83

moshthepitt commented 4 years ago

@cKellyDesign I think we should do that regardless, but I feel that it is not the core problem - whether something goes into the Redux store or not shouldn't matter - ama?

moshthepitt commented 4 years ago

ummm

So Zambia is currently doing this

moshthepitt commented 4 years ago

@cKellyDesign ^^

cKellyDesign commented 4 years ago

@moshthepitt Is there a level 0 Jurisdiction for Zambia?

moshthepitt commented 4 years ago

yes there is

moshthepitt commented 4 years ago

right now Zambia loads actually (coz we got some data synced) @cKellyDesign

cKellyDesign commented 4 years ago

@moshthepitt looks like it's working now in production

Screen Shot 2019-10-03 at 9 01 43 AM
moshthepitt commented 4 years ago

yeah we got data in. The screenshot above yours happens when there is no data for jurisdictions

moshthepitt commented 4 years ago

@cKellyDesign also, currently the map page is not showing on my end in Zambia

cKellyDesign commented 4 years ago

currently the map page is not showing on my end in Zambia

@moshthepitt Seems there are no Jurisdicitons in the superset slice with this planId: https://superset.reveal-zm.smartregister.org/superset/slice_json/160?form_data={%22adhoc_filters%22:[{%22clause%22:%22WHERE%22,%22expressionType%22:%22SIMPLE%22,%22comparator%22:%229f1e0cfa-5313-49ff-af2c-f7dbf4fbdb9d%22,%22operator%22:%22==%22,%22subject%22:%22plan_id%22}],%22row_limit%22:1}

moshthepitt commented 4 years ago

@cKellyDesign this is 100% Superset behaving badly, the unfiltered slice https://superset.reveal-zm.smartregister.org/superset/slice_json/160 has all the jurisdictions with that plan id :(

cKellyDesign commented 4 years ago

@moshthepitt yeah actually I just realized, it's passing when in the table, seems the only reason this is failing is because the map is not calling it with the sorting parameter which is being used in the Table.

Passing https://superset.reveal-zm.smartregister.org/superset/slice_json/160?form_data={%22order_by_cols%22:[%22[\%22jurisdiction_depth\%22,+true]%22],%22adhoc_filters%22:[{%22clause%22:%22WHERE%22,%22expressionType%22:%22SIMPLE%22,%22comparator%22:%229f1e0cfa-5313-49ff-af2c-f7dbf4fbdb9d%22,%22operator%22:%22==%22,%22subject%22:%22plan_id%22}],%22row_limit%22:3000}

Failing https://superset.reveal-zm.smartregister.org/superset/slice_json/160?form_data={%22adhoc_filters%22:[{%22clause%22:%22WHERE%22,%22expressionType%22:%22SIMPLE%22,%22comparator%22:%229f1e0cfa-5313-49ff-af2c-f7dbf4fbdb9d%22,%22operator%22:%22==%22,%22subject%22:%22plan_id%22}],%22row_limit%22:1}

moshthepitt commented 4 years ago

@cKellyDesign I believe it is caused by weird caching behaviour in Superset where that particular query was cached with no results

cKellyDesign commented 4 years ago

ah yeah i was also wondering about the caching, how long does the cache persist?

moshthepitt commented 4 years ago

1200 sec right now

cKellyDesign commented 4 years ago

@moshthepitt is this still an issue?

moshthepitt commented 4 years ago

Not sure. Lets close for now.