From 35f4ebfccb5672af65e3bacb0b6916240b021d37 Mon Sep 17 00:00:00 2001 From: Raj Shan <88.rajath@gmail.com> Date: Thu, 27 Aug 2026 11:04:09 -0700 Subject: [PATCH] Fix intermittent CoreServices XPC crash in RCTBlobManager blob name derivation --- packages/react-native/Libraries/Blob/RCTBlobManager.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Blob/RCTBlobManager.mm b/packages/react-native/Libraries/Blob/RCTBlobManager.mm index 8a4b6740ea15..4a29b1f826c9 100755 --- a/packages/react-native/Libraries/Blob/RCTBlobManager.mm +++ b/packages/react-native/Libraries/Blob/RCTBlobManager.mm @@ -297,11 +297,16 @@ - (id)handleNetworkingResponse:(NSURLResponse *)response data:(NSData *)data // An empty body will have nil for data, in this case we need to return // an empty blob as per the XMLHttpRequest spec. data = data ?: [NSData new]; + // -[NSURLResponse suggestedFilename] resolves the filename through a + // CoreServices/UTType XPC lookup that can crash intermittently + // (NSXPCEncoder) when called off the main thread. Since whatwg-fetch reads + // every response as a blob, that lookup used to run for every network + // response. Derive the name from the URL instead; no XPC round-trip. return @{ @"blobId" : [self store:data], @"offset" : @0, @"size" : @(data.length), - @"name" : RCTNullIfNil([response suggestedFilename]), + @"name" : RCTNullIfNil(response.URL.lastPathComponent), @"type" : RCTNullIfNil([response MIMEType]), }; }