From 8441bb12e922edc04f7c91fc89d0b8959cebf231 Mon Sep 17 00:00:00 2001 From: Dean Wenstrand Date: Wed, 22 Jul 2026 19:27:25 -0700 Subject: [PATCH] Select stream.id in upload-status operations so the cache stays normalized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UploadStreamWithDetails and the editUploadStream response selected stream fields without id. Apollo cannot normalize an object with no id selected, so every upload-service poll rewrote VideoGQL.stream as an anonymous inline object — clobbering the id that feed/detail queries select. Their cache reads went partial and useQuery silently fell back to the last network result, rendered as the home feed collapsing to the first page (and bouncing the viewport) whenever an upload was polling. Co-Authored-By: Claude Opus 4.8 --- src/index.tsx | 5 +++++ src/operations/video_upload.gql | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 8406cf5..3511e5a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -9031,6 +9031,7 @@ export type GetUploadLinkMutation = { }; stream?: { __typename?: "UploadStreamGQL"; + id: string; uploadCompletionCursor: number; } | null; }; @@ -9129,6 +9130,7 @@ export type UploadStreamWithDetailsFragment = { startTime?: any | null; stream?: { __typename?: "UploadStreamGQL"; + id: string; isCompleted: boolean; lastIntendedSegmentBound?: number | null; uploadCompletionCursor: number; @@ -9153,6 +9155,7 @@ export type GetUploadStreamsWithDetailsQuery = { startTime?: any | null; stream?: { __typename?: "UploadStreamGQL"; + id: string; isCompleted: boolean; lastIntendedSegmentBound?: number | null; uploadCompletionCursor: number; @@ -9692,6 +9695,7 @@ export const UploadStreamWithDetailsFragmentDoc = gql` name startTime stream { + id isCompleted lastIntendedSegmentBound uploadCompletionCursor @@ -19475,6 +19479,7 @@ export const GetUploadLinkDocument = gql` } } stream { + id uploadCompletionCursor } } diff --git a/src/operations/video_upload.gql b/src/operations/video_upload.gql index c35a9c2..b21fc7f 100644 --- a/src/operations/video_upload.gql +++ b/src/operations/video_upload.gql @@ -48,6 +48,7 @@ mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) { } } stream { + id uploadCompletionCursor } } @@ -127,6 +128,7 @@ fragment UploadStreamWithDetails on VideoGQL { name startTime stream { + id isCompleted lastIntendedSegmentBound uploadCompletionCursor -- 2.49.1