-
Notifications
You must be signed in to change notification settings - Fork 13
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
[TAS-324] ✨ Add suggested follow list #1328
base: develop
Are you sure you want to change the base?
[TAS-324] ✨ Add suggested follow list #1328
Conversation
currentFollowees[currentIndex] | ||
); | ||
|
||
const followSuggestions = [...followees, ...pastFollowees].filter( |
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.
Should not suggest pastFollowees
to users
while (suggestedSet.size < 3 && currentIndex < currentFollowees.length) { | ||
// eslint-disable-next-line no-await-in-loop | ||
const { followees = [], pastFollowees = [] } = await getUserFollowees( | ||
currentFollowees[currentIndex] | ||
); | ||
|
||
const followSuggestions = [...followees, ...pastFollowees].filter( | ||
f => !currentFolloweesSet.has(f) | ||
); | ||
|
||
followSuggestions.forEach(suggestion => suggestedSet.add(suggestion)); | ||
currentIndex += 1; |
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 would want avoid just leaking the whole follower list of currentIndex
to user. Thus we should limit and perform some randomization of the output
- Size of
currentFollowees
must be larger than a number, say 3, otherwise following 1 user would always yield result from that particular list currentFollowees
should contain some followees that are not already incurrentFolloweesSet
in order to be counted towards to the size limit above- We should randomly draw from
currentFollowees
instead of usingcurrentIndex
If the above conditions are not met, we should just return default suggestions/nothing.
Also note these rules are still not perfect, a better idea would be to use public information for suggestions, instead of non-public information like follower list i.e. use creators of NFT owned by a user
// Cache check and return cached result if it's valid | ||
if ( | ||
state.suggestedFollowList.length && | ||
!currentFollowees.some(user => state.suggestedFollowList.includes(user)) |
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.
Should we remove entry from suggestedFollowList
if user click follow in suggested list?
2023-09-15.12.04.24.mov