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

Feature: When switching accounts, construct in-group #13

Closed
Giszmo opened this issue Sep 24, 2022 · 4 comments · Fixed by #55
Closed

Feature: When switching accounts, construct in-group #13

Giszmo opened this issue Sep 24, 2022 · 4 comments · Fixed by #55
Labels
enhancement New feature or request
Milestone

Comments

@Giszmo
Copy link
Owner

Giszmo commented Sep 24, 2022

Currently all own accounts get assigned a degree:0, their follows that are not own accounts get assigned a degree:1 and their follows are degree:2 etc. This logic is relevant for the SharedWorker to know which events to download from relays but follows might be distinct between own accounts.

It's probably most efficient to implement a store of relevant accounts aka "in-group" where other components can quickly lookup which author to prioritize over another or which to disregard completely.

@Giszmo Giszmo added the enhancement New feature or request label Sep 24, 2022
@Giszmo Giszmo added this to the MVP milestone Sep 24, 2022
@Giszmo
Copy link
Owner Author

Giszmo commented Oct 26, 2022

When a profile is selected, the following should happen:

  • update the in-group store
  • add the selected profile's follows into the first level
  • add those profiles' follows that are not the selected or first degree follows into the second level
  • ...

The store probably needs a function to return the degree of a pubkey so it can display it quickly.


This is an idea of mine and not used in any other nostr client so far. My thesis is that we can store the 10k most relevant profiles (later we might have to tweak how to find them but so far there are no 10k profiles in total in all of nostr) and show the user only what happens in his proximity. If he follows 10k accounts, the follows of his follows are irrelevant. If he follows just one user who himself follows just two, he might see 8th degree follows' as in-group, too.

So #13 is just about compiling this list and keeping it ready, probably as a store. Downloading events is not required in this scope. Just work with what's downloaded already. The code for downloading events doesn't work account by account but considers all own accounts at startup and gets updated with every startup, so just assume the follows lists in IDB are up to date.

You might want to re-use part of the code from the logic that downloads relevant events as it constructs the n-th degree follows list already.

@louishuddleston
Copy link
Collaborator

@Giszmo would it make sense to use the existing profile cache store?

@Giszmo
Copy link
Owner Author

Giszmo commented Nov 12, 2022

Yes, the store can be used for that. The DB should keep using the overall followership but in memory the store may update that according to who's selected.

@louishuddleston
Copy link
Collaborator

Cool, that's how I've done it in #55

@Giszmo Giszmo closed this as completed Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants