Skip to content

Feat/tsa 318 social controller#8337

Merged
zone-live merged 13 commits intofeat/TSA-317-social-servicefrom
feat/TSA-318-social-controller
Mar 31, 2026
Merged

Feat/tsa 318 social controller#8337
zone-live merged 13 commits intofeat/TSA-317-social-servicefrom
feat/TSA-318-social-controller

Conversation

@Bigshmow
Copy link
Copy Markdown
Contributor

@Bigshmow Bigshmow commented Mar 30, 2026

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

  • 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

Medium Risk
Adds a new persisted BaseController with 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-controllers package with good test coverage.

Overview
Introduces SocialController (a BaseController) that persists social trading UI state and exposes messenger actions updateLeaderboard, followTrader, unfollowTrader, and updateFollowing, updating leaderboardEntries and followingAddresses based on SocialService responses.

Exports the new controller/types from index.ts, adds SocialControllerState to social-types, and wires in the @metamask/base-controller dependency/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.

@Bigshmow Bigshmow force-pushed the feat/TSA-318-social-controller branch 2 times, most recently from 352f037 to 6e417e8 Compare March 30, 2026 16:57
@Bigshmow Bigshmow marked this pull request as ready for review March 30, 2026 16:57
@Bigshmow Bigshmow requested review from a team as code owners March 30, 2026 16:57
@Bigshmow Bigshmow force-pushed the feat/TSA-318-social-controller branch 2 times, most recently from 0caceed to 60a196c Compare March 30, 2026 17:19
Bigshmow and others added 12 commits March 30, 2026 20:16
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>
@Bigshmow Bigshmow force-pushed the feat/TSA-318-social-controller branch from f51ab70 to a3e926b Compare March 31, 2026 02:35
Copy link
Copy Markdown

@cursor cursor bot left a comment

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.

@Bigshmow Bigshmow requested a review from mcmire March 31, 2026 03:07
@zone-live zone-live merged commit 979c611 into feat/TSA-317-social-service Mar 31, 2026
332 checks passed
@zone-live zone-live deleted the feat/TSA-318-social-controller branch March 31, 2026 08:43
@zone-live
Copy link
Copy Markdown
Contributor

Let's continue any other feedback in the destination branch: feat/TSA-317-social-service

@Bigshmow Bigshmow requested a review from zone-live March 31, 2026 13:57
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.

3 participants