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

fix: don't over-poll Spending Limits data #2407

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

iamacook
Copy link
Member

What it solves

Reduces eth_call requests

How this PR fixes it

The length of the modules array is checked instead of the array itself when requesting spending limit details in useLoadSpendingLimits.

useAsync linting changed the safe.modules length dependency in favour of safe.modules. This caused the increase of eth_call requests as a new instance of the Safe info is returned every poll due to the loading flag in useSafeInfo.

How to test it

Open a Safe with spending limits enabled and observe a reduced number of eth_calls when compared to prod.

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@iamacook iamacook self-assigned this Aug 16, 2023
@github-actions
Copy link

github-actions bot commented Aug 16, 2023

Branch preview

✅ Deploy successful!

https://update_spending_limits_deps--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@katspaugh katspaugh changed the title fix: check length of Safe modules array fix: don't over-poll Spending Limits data Aug 16, 2023
@katspaugh katspaugh changed the base branch from main to release/1.17.0 August 16, 2023 09:31
@katspaugh katspaugh merged commit 10f7f4c into release/1.17.0 Aug 16, 2023
6 of 7 checks passed
@katspaugh katspaugh deleted the update-spending-limits-deps branch August 16, 2023 09:31
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants