-
Notifications
You must be signed in to change notification settings - Fork 247
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(WC)_: Create indexes for WC queries #5989
base: develop
Are you sure you want to change the base?
Conversation
Jenkins Builds
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5989 +/- ##
===========================================
- Coverage 47.49% 47.48% -0.02%
===========================================
Files 849 849
Lines 138606 138606
===========================================
- Hits 65836 65813 -23
- Misses 64984 64996 +12
- Partials 7786 7797 +11
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
@alexjba do we really need this indexing?
Wondering now, how many rows do we expect from an average user?
Do we do any table cleaning once the session expires?
We don't do any cleaning! And then it could become an issue if the query is not optimized. Moreover, it adds some weight to this decision when we consider that everything is processed synchronously. Now the reasoning why we never delete sessions is another topic that should be discussed soon. What I've found so far is that this was an informed decision.
|
But the session has its own expiration date, I don't think that we need to keep an expired session in db, but agree we should discuss that. |
@clauxx The mobile WC integration is using the sessions and dapps stored in the DB? I see little value for these tables here, but maybe I'm missing something. IMO these tables are useful only to show some dapps if the user starts the app and the network is down. But this doesn't mean the dapp list is valid. Once WC is connected then the dapp list can change. So we could just inform the user that the network is down and wait for the connection before showing the connected dApps. As @saledjenic pointed out, there's this issue where we never delete sessions. So everything just piles up in the DB. From this perspective I think the DB needs to be optimized if these tables are useful to us. Either to delete sessions periodically, or to optimize the DB queries (or maybe both) |
Aside from the offline case, we don't clear expired sessions because we were planning to show the user their expired sessions next to the active ones (also we had some requirements to show all the sessions the user had with a specific dapp). No issues with indexing from my side. |
@clauxx where do those requirements come from? Does any other wallet offer you a list of expired or non-active sessions? Imagine how many entries can be here for a really active user in a year, and why, I don't see a need for that. |
Went through the designs and can't find them anymore, maybe misremembering. I guess it makes sense to clean up expired sessions, cause the validity seems to be ~ a week and with heavy usage might indeed grow too much.
Given the number of dapps available, it might be useful to show the user expired dapps they used before, so they can potentially re-connect to them, but it seems we don't have this requirement/user-story written anywhere, so could be irrelevant for now. |
Create the indexes needed for WalletConnect queries based on
.expert
recommendations.Fixing: status-im/status-desktop#14975