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

Upon restoring from seed phrase, app freezes while processing hundreds of undesirable contacts #21996

Open
ilmotta opened this issue Jan 28, 2025 · 0 comments

Comments

@ilmotta
Copy link
Contributor

ilmotta commented Jan 28, 2025

Problem

When restoring from seed phrase a user who has joined the Status community and after first login, the app freezes for a few seconds. Subsequent logins won't cause this issue.

Inspecting the SQL DB reveals that this profile has 800+ contacts in the contacts table, but in reality only a handful were actual contacts. Every contact where the column has_added_us is 0 and column contact_request_state is 0 will be a contact that will generate a re-frame event :activity-center/remove-pending-contact-request. The freeze happens because the CPU hogs while processing 800+ events in sequence (generated from status-im.contexts.chat.contacts.events/process-js-contacts).

The existing solution doesn't scale because a user pays the penalty of the size of communities and end up with potentially thousands of contacts in their local database.

Note: I (@ilmotta) have to yet to investigate if we can improve the implementation in status-go.

Impact

The impact seems to be low because the dramatic performance drop only happens upon first login after restoring, but since Status app should be prepared to handle larger communities, this problem may eventually be quite disruptive to users.

Acceptance Criteria

When restoring a profile, there should be minimal impact to start using the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant