From f38c5dca05fa2b69affa06d39dff9583e158be5a Mon Sep 17 00:00:00 2001 From: James Date: Sat, 22 Aug 2026 03:02:13 +0100 Subject: [PATCH] fix(mobile): stop the changed files widget from crashing ReviewSheet force-unwrapped resolveNativeReviewDiffView(), which is documented to return null while Expo registers the native view config and forever after a failed requireNativeView (e.g. a binary without the T3ReviewDiffSurface module). Rendering a null component type throws "Element type is invalid", which is fatal in release builds: the app crashes the moment the diff widget appears, and since the thread's review section auto-selects from persisted checkpoints, every reopen crashes again and the chat is burned. Null-check the resolver like ThreadFeed's ReviewCommentCard already does, and fall back to showing the raw patch when the native surface is unavailable. Fixes #7800 ox-alpha via opencode --- .../src/features/review/ReviewSheet.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/features/review/ReviewSheet.tsx b/apps/mobile/src/features/review/ReviewSheet.tsx index 0524371738fb..98bb72f1fbaf 100644 --- a/apps/mobile/src/features/review/ReviewSheet.tsx +++ b/apps/mobile/src/features/review/ReviewSheet.tsx @@ -398,7 +398,11 @@ export function ReviewSheet(props: ReviewSheetProps) { selectedSection, draftMessage, }); - const NativeReviewDiffView = resolveNativeReviewDiffView()!; + // Resolution returns null while Expo registers the native view (or forever + // when the binary lacks it). Rendering a null component type crashes the + // app, so callers must fall back — ThreadFeed's ReviewCommentCard does the + // same check. + const NativeReviewDiffView = resolveNativeReviewDiffView(); const nativeReviewDiffViewRef = useRef(null); const showcasedReviewDrawRef = useRef(null); // Native pull-to-refresh on the diff surface (replaces the old Refresh menu item). @@ -780,7 +784,7 @@ export function ReviewSheet(props: ReviewSheetProps) { onRetry={handleRetryEnvironment} /> - ) : selectedSection && parsedDiff.kind === "files" ? ( + ) : selectedSection && parsedDiff.kind === "files" && NativeReviewDiffView ? ( + ) : parsedDiff.kind === "files" ? ( + // The native diff surface could not be resolved on this binary; + // degrade to the raw patch instead of crashing the app. + + + Native diff view unavailable. Showing the raw patch. + + + + {selectedSection?.diff ?? ""} + + + ) : null} )}