Feat/tsa 318 social controller#8337
Merged
zone-live merged 13 commits intofeat/TSA-317-social-servicefrom Mar 31, 2026
Merged
Conversation
352f037 to
6e417e8
Compare
0caceed to
60a196c
Compare
mcmire
reviewed
Mar 30, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Set includeInDebugSnapshot and includeInStateLogs to false for both state fields (wallet addresses and social handles are PII) - Replace manual registerActionHandler calls with registerMethodActionHandlers and MESSENGER_EXPOSED_METHODS constant - Add auto-generated SocialController-method-action-types.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f51ab70 to
a3e926b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Contributor
|
Let's continue any other feedback in the destination branch: |
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
Adds SocialController — a BaseController extension that manages social trading state for the extension UI. Consumes the SocialService from TSA-317 and exposes 4 messenger actions for leaderboard and follow state management.
Why no TTL or caching logic
The controller acts as a simple store — no TTL, no eviction, no staleness checks. The social-api already caches upstream (leaderboard at 5min, positions at 30s), and the UI knows best when to re-fetch (screen focus, pull-to-refresh, user actions). Double-caching adds complexity without meaningful benefit. State is persisted across sessions so the UI can render immediately on startup while a fresh fetch is in flight.
See CHANGELOG.md for the full list of additions.
References
Checklist
Note
Medium Risk
Adds a new persisted
BaseControllerwith messenger-exposed methods that update stored follow/leaderboard state, which could affect UI behavior and state persistence if wiring or state updates are incorrect. Changes are scoped to the new@metamask/social-controllerspackage with good test coverage.Overview
Introduces
SocialController(aBaseController) that persists social trading UI state and exposes messenger actionsupdateLeaderboard,followTrader,unfollowTrader, andupdateFollowing, updatingleaderboardEntriesandfollowingAddressesbased onSocialServiceresponses.Exports the new controller/types from
index.ts, addsSocialControllerStatetosocial-types, and wires in the@metamask/base-controllerdependency/TS project references. Adds comprehensive unit tests covering state updates, messenger callability, and error propagation, and updates the changelog accordingly.Written by Cursor Bugbot for commit a6a3c13. This will update automatically on new commits. Configure here.