Skip to content

Feat/social controllers leaderboard opt out in#9354

Merged
Bigshmow merged 7 commits into
mainfrom
feat/social-controllers-leaderboard-opt-out-in
Jul 2, 2026
Merged

Feat/social controllers leaderboard opt out in#9354
Bigshmow merged 7 commits into
mainfrom
feat/social-controllers-leaderboard-opt-out-in

Conversation

@Bigshmow

@Bigshmow Bigshmow commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Explanation

Adds optOutOfLeaderboard and optInToLeaderboard to SocialController and SocialService, with their corresponding messenger actions. @metamask/social-controllers previously had no way to opt a user out of (or back into) the Top Traders leaderboard; the mobile client needs these to remove/restore a user from the global, Clicker-backed leaderboard. Each method POSTs to the existing social-api endpoint (/leaderboard/opt-out, /leaderboard/opt-in) with the JWT already attached by SocialService, and resolves to void on the backend's 204. Purely additive — no existing methods, types, or behavior change.

References

  • Related to TSA-830 - leaderboard opt-out: client flow + AUS persistence. Consumed by the MetaMask mobile client.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Purely additive API surface with tests; no changes to existing methods, state, or auth flow beyond new leaderboard preference calls.

Overview
Adds optOutOfLeaderboard and optInToLeaderboard to @metamask/social-controllers so clients (e.g. mobile) can remove or restore the signed-in user on the Top Traders / PnL leaderboard.

SocialService issues JWT-authenticated POST requests to /api/v1/leaderboard/opt-out and /api/v1/leaderboard/opt-in, treats success as 204, and surfaces failures via new LEADERBOARD_OPT_OUT_FAILED / LEADERBOARD_OPT_IN_FAILED messages. SocialController exposes the same operations as thin messenger delegates (no controller state changes). Messenger action types, package exports, changelog, and unit tests are updated accordingly.

Reviewed by Cursor Bugbot for commit bdef2c4. Bugbot is set up for automated code reviews on this repo. Configure here.

@Bigshmow Bigshmow requested review from a team as code owners July 2, 2026 02:52
@Bigshmow Bigshmow temporarily deployed to default-branch July 2, 2026 02:52 — with GitHub Actions Inactive

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7ef12e6. Configure here.

Comment thread packages/social-controllers/src/SocialService.ts
Bigshmow and others added 4 commits July 1, 2026 21:10
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s.ts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…valid JSDoc blocks

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Bigshmow Bigshmow added this pull request to the merge queue Jul 2, 2026
Merged via the queue into main with commit 2dd6aeb Jul 2, 2026
409 checks passed
@Bigshmow Bigshmow deleted the feat/social-controllers-leaderboard-opt-out-in branch July 2, 2026 14:27
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