Skip to content

Fix race condition when changing dashboard filters quickly

Elwyn Benson requested to merge order-panels-responses into master

What does this MR do and why?

Filtering analytics dashboards queues up multiple queries, which introduced a race condition where it was possible for newer network requests to complete before older (stale) ones, which resulted in stale data being displayed once the old requests completed.

Related issue: Changing the date while dashboard visualization... (#444251 - closed)

We now order requests in panels_base so that only the newest request data is ever displayed

This MR is part of a larger MR which was split into parts:

# MR status
1️⃣ Fix race condition when changing dashboard filt... (!152021 - merged) <-- you are here
2️⃣ Refactor analytics data sources (!152022 - merged)
3️⃣ Cancel duplicate network requests when filterin... (!151603 - closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No visual changes.

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. Onboard Product Analytics by setting up the feature at Project > Analytics > Analytics dashboards.
  3. Generate some events for this project so your dashboards have data.
  4. View a dashboard, and flip the date filter value very quickly. You will see additional network requests fire each time. It can be tricky to reproduce the original bug, I suggest using the devtools network panel "throttling" feature (slow-3g) to give yourself more time to toggle filters.
Edited by Jiaan Louw

Merge request reports