From 51cb4513f57f4c2e5b521d40bd4b7f15e0e27193 Mon Sep 17 00:00:00 2001 From: Bigshmow Date: Tue, 16 Jun 2026 18:40:36 -0600 Subject: [PATCH] chore!: remove TraderProfileResponse.followingCount The social-api response contract was changed in social-api PR #88 to drop `followingCount` (it had been a transitional duplicate of `metrics.allPartners.followingCount` and is no longer surfaced as a top-level field). The SDK's runtime validation struct still required it, causing `fetchTraderProfile` to throw `FETCH_TRADER_PROFILE_INVALID_RESPONSE` and breaking the mobile trader profile view. Rather than relaxing the field to optional (a half-step that leaves a dead field in the SDK contract), remove it entirely from both the runtime struct and the TypeScript type so the SDK's view of the response matches what the API actually delivers. No current consumers depend on the field (verified across the MetaMask ecosystem before removal). BREAKING CHANGE: `TraderProfileResponse.followingCount` is removed. Consumers that read `result.followingCount` will see a TypeScript compile error after upgrading and must remove their references. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/social-controllers/CHANGELOG.md | 4 ++++ packages/social-controllers/src/SocialService.test.ts | 2 +- packages/social-controllers/src/SocialService.ts | 1 - packages/social-controllers/src/social-types.ts | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/social-controllers/CHANGELOG.md b/packages/social-controllers/CHANGELOG.md index 12e08b6f8d..7fee5793d0 100644 --- a/packages/social-controllers/CHANGELOG.md +++ b/packages/social-controllers/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Removed + +- **BREAKING:** Remove `TraderProfileResponse.followingCount` from both the runtime validation struct (`TraderProfileResponseStruct`) and the TypeScript type. The social-api response contract no longer surfaces this field (it had been a transitional duplicate of `metrics.allPartners.followingCount`), and the SDK was rejecting otherwise-valid responses because the struct still required it. No current consumers depend on the field. + ## [2.3.0] ### Added diff --git a/packages/social-controllers/src/SocialService.test.ts b/packages/social-controllers/src/SocialService.test.ts index 4ddf666f2e..757e07d180 100644 --- a/packages/social-controllers/src/SocialService.test.ts +++ b/packages/social-controllers/src/SocialService.test.ts @@ -317,7 +317,6 @@ describe('SocialService', () => { }, socialHandles: mockSocialHandles, followerCount: 100, - followingCount: 50, }; it('fetches trader profile from correct endpoint', async () => { @@ -404,6 +403,7 @@ describe('SocialService', () => { expect(result.stats).toStrictEqual({}); }); + }); describe('fetchOpenPositions', () => { diff --git a/packages/social-controllers/src/SocialService.ts b/packages/social-controllers/src/SocialService.ts index 3401fe7bf1..20dbcf9b2f 100644 --- a/packages/social-controllers/src/SocialService.ts +++ b/packages/social-controllers/src/SocialService.ts @@ -142,7 +142,6 @@ const TraderProfileResponseStruct = structType({ perChainBreakdown: PerChainBreakdownStruct, socialHandles: SocialHandlesStruct, followerCount: number(), - followingCount: number(), }); const PositionsResponseStruct = structType({ diff --git a/packages/social-controllers/src/social-types.ts b/packages/social-controllers/src/social-types.ts index f9e5a57158..b8aa2fb602 100644 --- a/packages/social-controllers/src/social-types.ts +++ b/packages/social-controllers/src/social-types.ts @@ -134,7 +134,6 @@ export type TraderProfileResponse = { perChainBreakdown: PerChainBreakdown; socialHandles: SocialHandles; followerCount: number; - followingCount: number; }; // ---------------------------------------------------------------------------