Skip to content

Fix data refresh, variable shadowing, and timer leak in staking dashboard#2390

Draft
Copilot wants to merge 57 commits intodevelopfrom
copilot/sub-pr-2386
Draft

Fix data refresh, variable shadowing, and timer leak in staking dashboard#2390
Copilot wants to merge 57 commits intodevelopfrom
copilot/sub-pr-2386

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 24, 2026

The useNetworkStats hook migrated from SWR hooks to imperative API calls but lost automatic data revalidation. A lastFetchedNetworksKey ref prevented all re-fetching after initial load, so dashboard data (node status, validators, signers) would go stale permanently.

Changes

  • Add 30s polling interval in useNetworkStats — replaces the stale-preventing ref with setInterval/clearInterval so node status, validator data, and signer status refresh periodically
  • Fix variable shadowing — inner let installedDnpNames shadowed the React state variable from useState; renamed to resolvedInstalledDnpNames
  • Clean up timeout timer in fetchClientWithTimeoutsetTimeout was never cleared on successful fetch; added finally block with clearTimeout
  • Remove unused useRef import

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…lean up timeout timer

Co-authored-by: Marketen <36164126+Marketen@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 24, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • binaries.soliditylang.org
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • ethereum.github.io
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • relay.trufflesuite.com
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • solc-bin.ethereum.org
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor and optimize fetching of network statistics Fix data refresh, variable shadowing, and timer leak in staking dashboard Feb 24, 2026
Base automatically changed from mateu/dashboard-fixes to mateu/staking-dashboard February 24, 2026 08:50
Base automatically changed from mateu/staking-dashboard to develop February 24, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants