From 0dcf5b7a1f77df371a8e6108916ba9dbdbb0cbf0 Mon Sep 17 00:00:00 2001 From: Dylan Audius Date: Thu, 2 Jul 2026 11:05:39 -0700 Subject: [PATCH 1/2] fix(types): preserve permalink on RemixContestEvent OverrideProperties loses the optional permalink property because type-fest's Merge/Simplify chain doesn't fully distribute through the doubly-nested intersection that Event resolves to. Intersect Pick explicitly so the type survives and ContestScreen can access contest.permalink without a TS2339 error. Co-Authored-By: Claude Sonnet 4.6 --- .../common/src/api/tan-query/events/useRemixContest.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/common/src/api/tan-query/events/useRemixContest.ts b/packages/common/src/api/tan-query/events/useRemixContest.ts index dea360e8d1b..655c78fbca9 100644 --- a/packages/common/src/api/tan-query/events/useRemixContest.ts +++ b/packages/common/src/api/tan-query/events/useRemixContest.ts @@ -19,12 +19,17 @@ export type RemixContestData = { sourceTrackIds?: number[] } +// Note: OverrideProperties/Merge/Simplify from type-fest can lose optional +// properties on doubly-nested intersection types (e.g. permalink? on Event, +// which is itself an OverrideProperties of EventSDK). We explicitly intersect +// Pick to ensure the property survives the simplification. type RemixContestEvent = OverrideProperties< Event, { eventData: RemixContestData } -> +> & + Pick /** * Hook to fetch the remix contest event for a given entity ID. From 307f2d5b91864b7611fcb95b51ee893958a36f3c Mon Sep 17 00:00:00 2001 From: Dylan Audius Date: Thu, 2 Jul 2026 11:07:00 -0700 Subject: [PATCH 2/2] fix(types): remove permalink from Event type and ContestScreen usage permalink was speculatively added to EventSDK and the common Event model but the API does not return it. Remove it from both the SDK type and the common model, revert the useRemixContest Pick patch, and drop contest?.permalink from ContestScreen's useCallback dep array. Fixes TS2339 and the exhaustive-deps lint warning in CI. Co-Authored-By: Claude Sonnet 4.6 --- .../common/src/api/tan-query/events/useRemixContest.ts | 7 +------ .../mobile/src/screens/contest-screen/ContestScreen.tsx | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/common/src/api/tan-query/events/useRemixContest.ts b/packages/common/src/api/tan-query/events/useRemixContest.ts index 655c78fbca9..dea360e8d1b 100644 --- a/packages/common/src/api/tan-query/events/useRemixContest.ts +++ b/packages/common/src/api/tan-query/events/useRemixContest.ts @@ -19,17 +19,12 @@ export type RemixContestData = { sourceTrackIds?: number[] } -// Note: OverrideProperties/Merge/Simplify from type-fest can lose optional -// properties on doubly-nested intersection types (e.g. permalink? on Event, -// which is itself an OverrideProperties of EventSDK). We explicitly intersect -// Pick to ensure the property survives the simplification. type RemixContestEvent = OverrideProperties< Event, { eventData: RemixContestData } -> & - Pick +> /** * Hook to fetch the remix contest event for a given entity ID. diff --git a/packages/mobile/src/screens/contest-screen/ContestScreen.tsx b/packages/mobile/src/screens/contest-screen/ContestScreen.tsx index 737d8e98b48..91b4805b4b4 100644 --- a/packages/mobile/src/screens/contest-screen/ContestScreen.tsx +++ b/packages/mobile/src/screens/contest-screen/ContestScreen.tsx @@ -220,7 +220,7 @@ export const ContestScreen = () => { source: ShareSource.PAGE }) ) - }, [dispatch, trackId, contest?.permalink]) + }, [dispatch, trackId]) // Pull-to-refresh: invalidate the contest's event + comment queries so all // tabs (details, updates, submissions, comments) refetch the next time