-
Notifications
You must be signed in to change notification settings - Fork 456
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
refactor: use rtk query for loading owned safes #4356
Conversation
Branch preview✅ Deploy successful! Storybook: |
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! One Page Changed SizeThe following page changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. |
Coverage report
Show files with reduced coverage 🔻
Test suite run success1504 tests passing in 204 suites. Report generated by 🧪jest coverage report action from 786d9b6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to include extractRehydrationInfo
for persistence of the new endpoints
.
@iamacook we are not persisting this data? On refresh of the page we should fetch it from the server again. What I noticed that is that when the sidebar is closed there is no query that need the data so rtk is unsubscribing from the query after 60s. We should actually increase the caching time to maybe something like 10mins? |
The cached owners and all Safes are initially returned. This means that a returning user would already have a populated sidebar, for instance. However, whether we want to keep this behavior is open for discussion, particularly when considering the complexity of implementing it with RTK Query. |
I've since realised we should definitely test creating/being added to a Safe now that the caching has been adjusted, and if it correctly updates. |
Closing it until we rework the sidebar. Reason:
I think to properly improve this we should redesign the sidebar and rework the sidebar logic such that we do not require all owned Safes anymore to render the basic Sidebar. |
What it solves
Resolves #4350
How this PR fixes it
Uses RTK query and its caching to load owned Safes.
How to test it
Checklist