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

Social proof #2557

Merged
merged 48 commits into from
Jun 11, 2024
Merged

Social proof #2557

merged 48 commits into from
Jun 11, 2024

Conversation

estrattonbailey
Copy link
Member

@estrattonbailey estrattonbailey commented Jun 6, 2024

Adds knownFollowers to ViewerState on ProfileDetailed views. This includes:

  • getProfiles
  • getProfile
  • getSuggestedFollowsByActor
  • getSuggestions

Also adds getKnownFollowers method that returns the full list of known followers for a given actor. This is set up for pagination, but is not actually paginated atm due to dataplane constraints.

@estrattonbailey estrattonbailey force-pushed the social-proof branch 2 times, most recently from cc99a1f to 569c40a Compare June 6, 2024 18:57
devinivy and others added 14 commits June 7, 2024 12:05
* Update deactivation through updateSubjectStatus (#2539)

* attach hosting status to entryway session responses

* integrate account deactivation in with entryway

* tidy

* tidy

* chnageset

* update changeset

* Version packages (#2546)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* lexicon: initial social proof lexicons

* feat: add generated types for social proof

* feat: social proof implementation

---------

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Devin Ivy <devinivy@gmail.com>
@estrattonbailey estrattonbailey marked this pull request as ready for review June 7, 2024 19:44
Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lookin good! 💪

left a couple notes - big one is to tidy up the protos file

Comment on lines 234 to 237
const followers = mapDefined(knownFollowers.followers, (did) => {
return this.profileBasic(did, state)
})
return { count: knownFollowers.count, followers }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that there is a minimum of one item for followers. It would be nice to have some logic enforcing that colocated around here, or perhaps drop the requirement from the lexicon if you think the frontend wont mind.

We may also want to consider enforcing blocks, and possibly mutes, in this list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We updated this the other day to 0. Yeah I'll make sure frontend can handle it, no issue there.

Yeah should def filter out blocks, I think mutes are OK to leave in though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya know, hadn't codegenned though, glad you brought this up.

Blocks are now filtered, added a test

Comment on lines +607 to +609
const knownFollowers = carolForAlice.data.viewer?.knownFollowers
expect(knownFollowers?.count).toBe(1)
expect(knownFollowers?.followers).toHaveLength(0)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting here count is 1, but the blocked user has been filtered out. We return 5 to the client, and the client uses only 3, so we're already overfetching. Discussed with Devin and decided this was a rare enough case to leave in for now. Frontend will handle the difference.

@dholms dholms merged commit 58abcbd into main Jun 11, 2024
10 checks passed
@dholms dholms deleted the social-proof branch June 11, 2024 17:34
@github-actions github-actions bot mentioned this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants