feat(social-controllers): add moderation block methods to SocialService - #10656
Merged
Merged
Conversation
Wrap the social-api block, blocked-profiles, and blocked-content endpoints so clients can record and list moderation blocks. Co-authored-by: João Santos <joaosantos15@users.noreply.github.com>
Co-authored-by: João Santos <joaosantos15@users.noreply.github.com>
joaosantos15
marked this pull request as ready for review
October 1, 2026 13:04
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
zone-live
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The social API already exposes moderation block endpoints, but
@metamask/social-controllersdid not wrap them, so clients had no messenger actions for blocking a trader, comment, or reply, or for listing those blocks.This adds three
SocialServicemethods, each mapping to one endpoint:blockcallsPUT /api/v1/moderation/blockwith exactly one ofprofileId,commentId, orreplyId, plus an optionalreason. The endpoint returns 204.fetchBlockedProfilescallsGET /api/v1/moderation/blocks/profiles.fetchBlockedContentcallsGET /api/v1/moderation/blocks/content.Both list methods take an optional
cursorand return the page plus the next cursor (nullon the last page). Responses are validated with superstruct, matching the other social-api methods. These stay onSocialServiceonly;SocialControllerstill stores leaderboard and follow state and does not persist blocks.References
PUT /api/v1/moderation/block,GET /api/v1/moderation/blocks/profiles,GET /api/v1/moderation/blocks/contentChecklist