Remove unnecessary polling of statistics endpoint
- Dominant language
- Scala
- Stars
- 301
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
When I go to a project page like [this one](https://bbp.epfl.ch/nexus/web/orgs/bbp/somatosensorycortex/) and open network panel I see requests made to /statistics endpoint every 3 seconds.
These requests are made even when the indexing has completed. When I go to "Statistics" tab, the user does not even see any information (perhaps because they don't have access to the project) but the polling keeps going.

Furthermore, in some cases, switching back from "Statistics" tab to "Browse" tab, triggers extra ~10 requests right away without 3 seonds wait (I saw this on [this project](https://sbo-nexus-fusion.shapes-registry.org/nexus/web/orgs/public/thalamus), but not on [this isocortext project](https://bbp.epfl.ch/nexus/web/orgs/bbp/somatosensorycortex/)).
The polling of statistics endpoint should stop (or reduce) in following cases:
- When user switches from statistics tab to browse tab
- When user does not have access to the project (and can therefore not see any statistics info on screen)
- When indexing has completed
Contributor guide
Research direction
Start from the project page and its /statistics endpoint polling, then compare the Statistics and Browse tab transitions described in the issue. Verify that polling stops or is reduced after switching tabs, without project access, and after indexing completes, including the reported burst of requests on returning to Browse.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100