PostHog / PostHog/posthog

[customer analytics] Refresh button double-click race on accounts list (loading state already exists)

Open Beginner friendly
#68,908 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature/customer-analytics
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Summary

Low priority. The Refresh button on the accounts list already shows a loading spinner and disabled state while a refresh is in flight, so it is not actually "dead". The only remaining gap is a sub-frame double-click race: a second click landing before React re-renders the disabled state can fire a second refresh. Optional fix: no-op the refresh listener while already loading.

Part of #68887.

Investigation note: filed for completeness. The originally-observed "refresh feels unresponsive" dead-clicks are largely explained by this pre-render window plus normal ~1s query latency, not a missing loading state.

Details for coding agents

Current behavior (correct)
AccountsTabFilters reads responseLoading from the bound dataNodeLogic and passes loading={accountsLoading} + disabledReason={accountsLoading ? 'Loading…' : undefined} to the Refresh LemonButton.

Proposed fix (optional)
Guard the refresh listener in accountsLogic to return early if the list node is already loading, closing the double-submit window even before the disabled state renders.

References

  • products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx:26,56-65 (loading/disabled already wired)
  • products/customer_analytics/frontend/components/Accounts/accountsLogic.ts:537-544 (refresh listener → loadData('force_async'))

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx at the existing loading and disabled wiring, then inspect accountsLogic.ts:537-544 and its refresh listener. Verify the loading state remains correct and that a rapid double-click on Refresh results in only one refresh request.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.