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 blocks #2603

Merged
merged 13 commits into from
Jul 2, 2024
Merged

Social proof blocks #2603

merged 13 commits into from
Jul 2, 2024

Conversation

estrattonbailey
Copy link
Member

@estrattonbailey estrattonbailey commented Jun 25, 2024

This PR ensures that if I follow Daniel, and Daniel follows Devin, but Devin blocks Daniel, when I view Devin's profile I do not see Daniel as part of knownFollowers.

I also extracted some utils and added a few tests + added a new seed specifically for knownFollowers testing to handle these 2nd-party blocks more clearly/easily.

Comment on lines 1067 to 1070
bidirectionalBlocks: mergeMaps(
stateA.bidirectionalBlocks,
stateB.bidirectionalBlocks,
),
Copy link
Collaborator

@devinivy devinivy Jun 26, 2024

Choose a reason for hiding this comment

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

The way bidirectionalBlocks works, I think this would allow some clobbering to happen. For example, how should these two merge?

{ did:example:a -> { did:example:b -> true } }
{ did:example:a -> { did:example:c -> true } }

I think we'd want to find something like this:

{ did:example:a -> { did:example:b -> true, did:example:c -> true } }

As-is I think it would end-up like this, and we'd lose did:example:b:

{ did:example:a -> { did:example:c -> true } }

estrattonbailey and others added 8 commits June 26, 2024 16:08
Co-authored-by: devin ivy <devinivy@gmail.com>
* origin/main:
  Appview: simple fix for no-hosted known followers (#2609)
  bsky: syntax typo in README (#2601)
  Use detailed profile view for `getSuggestions` (#2596)
@estrattonbailey estrattonbailey marked this pull request as ready for review June 27, 2024 00:02
Comment on lines +28 to +31
export const mergeMaps = <V, M extends HydrationMap<V>>(
mapA?: M,
mapB?: M,
): M | undefined => {
Copy link
Member Author

Choose a reason for hiding this comment

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

@devinivy special note: I axed the Merges interface here so that I could use this more easily within mergeNestedMaps. No change to types or functionality that I can tell, but unsure if I knocked over Chesteron's Fence anywhere else.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also general note that I extracted these and made a util.test.ts test

Copy link
Collaborator

@devinivy devinivy left a comment

Choose a reason for hiding this comment

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

Good stuff!

@devinivy devinivy merged commit e54518f into main Jul 2, 2024
10 checks passed
@devinivy devinivy deleted the social-proof-blocks branch July 2, 2024 21:48
estrattonbailey added a commit that referenced this pull request Jul 16, 2024
…cements

* origin/main: (181 commits)
  Minor OAuth client fixes (#2640)
  Version packages (#2639)
  OAuth: 2FA (#2633)
  Version packages (#2622)
  Update data source for `getSuggestedFollowsByActor` (#2630)
  Add in-memory did cache to Ozone backend (#2635)
  Filter out reference lists from `getLists` (#2629)
  lexicons: add missing ozone Tag event type to unions (#2632)
  ✨ Add ozone proxy for getLikes and getRepostedBy (#2624)
  Upgrade pnpm/action-setup in workflows (#2625)
  ✨ Add proxy for user typeahead through ozone (#2612)
  Fix development commands (#2623)
  Add starter packs to post hydration (#2613)
  Social proof blocks (#2603)
  Appview: apply hosting status in getRecord (#2620)
  Add `labelersPref` to `getPreferences` union return types (#2554)
  Version packages (#2618)
  Add new preference and api for bsky app state; also put preference updates within transactional lock regions (#2492)
  remove mentions of sandbox (#2611)
  Appview: simple fix for no-hosted known followers (#2609)
  ...
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.

2 participants