Kibana: Avoid storing list's page # in localStorage

Created on 8 Oct 2019  路  2Comments  路  Source: elastic/kibana

We are currently storing the page in localStorage in all of our listing pages which means it'll be remembered "indefinitely". This causes a bug where whenever you go back to that listing page and that data is no longer there, it'll show "no data" message even though there might still be data on the first page.

Steps to reproduce:

  • Add a lot of entities to a listing page, I'll use 10 pipelines for my example
  • Go to that page, so Stack Monitoring > Pipelines
  • Set the amount per page to 5
  • Go to page # 2
  • Go to a completely different page
  • Reduce the entities to something less than 5. In my case it'll be restarting Logstash with 3 pipelines
  • Go back to Stack Monitoring > Pipelines
  • Notice you'll get "no data" message even-though you still have 3 entities. You can't even go to the first page because the pagination is hidden. The only fix would be to run localStorage.removeItem('xpack.monitoring.data') and refresh the page

Possible solutions:

  1. Never save the page # and always start with the first page when they come back to that listing page
  2. Store the page in memory rather than localStorage. There is still a possibility of triggering the same bug with this solution, but it's less likely.
  3. Make it a bit smarter, eg: if we receive no data for a page greater than 1, we go to page one and refetch

I personally favor solution # 1, since it'll be that fastest and the easiest to implement (with less potential for bugs). Would like to here other opinions though

Monitoring bug

Most helpful comment

I'm starting to like # 1 too. I don't know how useful this feature has been - I think the downsides might outweigh the benefit here. Honestly, our filtering/sorting capabilities should make it easy for a user to find anything in case they are going back and forth.

All 2 comments

Pinging @elastic/stack-monitoring (Team:Monitoring)

I'm starting to like # 1 too. I don't know how useful this feature has been - I think the downsides might outweigh the benefit here. Honestly, our filtering/sorting capabilities should make it easy for a user to find anything in case they are going back and forth.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timmolter picture timmolter  路  3Comments

stacey-gammon picture stacey-gammon  路  3Comments

celesteking picture celesteking  路  3Comments

tbragin picture tbragin  路  3Comments

spalger picture spalger  路  3Comments