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

Refresh all dashboard items #3609

Closed
2 tasks done
paolodamico opened this issue Mar 9, 2021 · 3 comments · Fixed by #4598
Closed
2 tasks done

Refresh all dashboard items #3609

paolodamico opened this issue Mar 9, 2021 · 3 comments · Fixed by #4598
Assignees
Labels
enhancement New feature or request feature/dashboards Feature Tag: Dashboards P1 Urgent, non-breaking (no crash but low usability)

Comments

@paolodamico
Copy link
Contributor

paolodamico commented Mar 9, 2021

Bug description

Support refreshing all dashboard items. This feature was temporarily removed because it wasn't working properly)

Expected behavior

  • All dashboard items should be properly refreshed and the items object in the dashboardLogic should contain the latest information.
  • From user feedback. I expect items to be automatically refreshed every hour or so (e.g. if I'm a marketer that looks at graphs continuously during the day, or have a screen dedicated just to metrics).

How to reproduce

  1. Create a dashboard with multiple items
  2. Attempt to refresh all and check the last refresh timestamp for each item (remember to uncomment relevant code)

Environment

  • PostHog Cloud
  • self-hosted PostHog, version/commit: please provide

Additional context

Follow-up to #3363

Technical context

When refreshing all dashboard items (via refreshAllDashboardItems()) not all items are consistently refreshed all the time. Tested for instance with a dashboard with a couple of mixed (different type) graphs. Some items are still kept on "last refreshed 10 minutes ago".

In addition to the above, as originally reported on #3608, when calling refreshAllDashboardItems we update each item in their own scope, which means that the general items object in the upper scope logic (dashboardLogic.js) doesn't get updated. Not sure if we should propagate the change upwards, re-fetch everything, or just do a general refresh.

The UX problem this is causing is that the "Last refreshed" label now introduced in the dashboards gets outdated because items doesn't get updated. Having this object with outdated information also leads to other confusing UX issues.

Thank you for your bug report – we love squashing them!

@paolodamico paolodamico added bug Something isn't working right feature/dashboards Feature Tag: Dashboards labels Mar 9, 2021
@Mentioum
Copy link

Mentioum commented Mar 19, 2021

Excellent - this is a big usability issue when training marketing people to use graphs. Makes them not trust the data and regress to other tooling. <3

Short term fix is to 'hard refresh' and it tends to work for anyone who's finding this too frustrating in the meantime.

@paolodamico
Copy link
Contributor Author

We should also add an auto-refresh option for dashboards

@paolodamico paolodamico added P1 Urgent, non-breaking (no crash but low usability) enhancement New feature or request and removed bug Something isn't working right labels May 13, 2021
@paolodamico paolodamico changed the title Bug refreshing all dashboard items Refresh all dashboard items May 13, 2021
@macobo
Copy link
Contributor

macobo commented May 21, 2021

This is gonna be needed for instance status dashboard.

@mariusandra mariusandra self-assigned this Jun 3, 2021
macobo added a commit that referenced this issue Jun 4, 2021
Also `internal` dashboard always refreshes all.

How it works under the hood - if refresh param is passed, we call cache
updating code before returning the cached results. This bypasses the
need to fetch data from /api/insight and other endpoints which are not
embedding-aware

Mostly solves #3609 and
provides a workaround for #4587
macobo added a commit that referenced this issue Jun 10, 2021
Also `internal` dashboard always refreshes all.

How it works under the hood - if refresh param is passed, we call cache
updating code before returning the cached results. This bypasses the
need to fetch data from /api/insight and other endpoints which are not
embedding-aware

Mostly solves #3609 and
provides a workaround for #4587
macobo added a commit that referenced this issue Jun 10, 2021
)

* Re-add refresh button, respect refresh in API

Also `internal` dashboard always refreshes all.

How it works under the hood - if refresh param is passed, we call cache
updating code before returning the cached results. This bypasses the
need to fetch data from /api/insight and other endpoints which are not
embedding-aware

Mostly solves #3609 and
provides a workaround for #4587

* Show "last refresh time" in dashboard.

* Remove individual refresh buttons according to TODO

* Add tests

* mypy fix

* fix UI

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature/dashboards Feature Tag: Dashboards P1 Urgent, non-breaking (no crash but low usability)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants