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

#156 Disable query polling #157

Merged

Conversation

nevendyulgerov
Copy link
Contributor

Summary

I removed the pollInterval setting for all graphql queries so that we are doing any http requests to the graphql BE only on page load. This can be easily noticed on the /blocks page, where we were previously polling a lot of data every 30 seconds.

I also checked the useBlockNumber custom hook that we have in /staking/src/services/eth.tsx. It is used on most of the pages and although it often causes re-renders in components that use it (because the block number changes every ~15 seconds), I didn't notice it causing any side effects like extra http requests happening. That's why I didn't make any changes in useBlockNumber.

Testing Instructions

  1. Build the app locally for dev env
  2. Go to the / (home), or /blocks , or any other page where we were previously polling the graphql queries
  3. Observe the network requests
  4. Notice that no extra network requests for the page data are being made to the graphql BE after the page load

@nevendyulgerov nevendyulgerov self-assigned this Jul 26, 2024
Copy link

vercel bot commented Jul 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2024 10:59am

@nevendyulgerov nevendyulgerov linked an issue Jul 26, 2024 that may be closed by this pull request
2 tasks
@nevendyulgerov nevendyulgerov marked this pull request as draft July 26, 2024 14:37
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10131129284

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 77.511%

Totals Coverage Status
Change from base Build 10001733387: 0.0%
Covered Lines: 338
Relevant Lines: 401

💛 - Coveralls

@nevendyulgerov nevendyulgerov marked this pull request as ready for review July 28, 2024 11:04
@nevendyulgerov nevendyulgerov requested a review from tuler July 28, 2024 11:05
@nevendyulgerov nevendyulgerov added the type:feature new feature or improvement over an existing feature label Jul 28, 2024
@brunomenezes brunomenezes merged commit 14cd9fb into main Aug 6, 2024
6 of 7 checks passed
@brunomenezes brunomenezes deleted the feature/156-disable-reinvocation-on-block-change-event branch August 6, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature new feature or improvement over an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate and disable re-running of hooks on block change event
3 participants