From 1ac4e378a5532345c3cc2781cfe08759cc857810 Mon Sep 17 00:00:00 2001 From: Denis Sheikherev Date: Thu, 29 Oct 2026 17:58:29 +0700 Subject: [PATCH 1/2] iOS: import the wrapper contract from Bugsee.SPI when the SDK has it The iOS SDK 7.0 GA moves the wrapper contract (BGSWrapperChannel, BGSReportContract, BGSAttachmentContract, BGSCallback, BugseeWrapper, +setWrapper:, ...) out of Bugsee.h into the Bugsee.SPI submodule (BugseeSPI.h), which `import Bugsee` / no longer brings in. BugseeModule.mm, the three BugseeRNSupport headers that name those types (BGSRNReportOps.h, BGSRNReportHandlerBridge.h, BGSRNWrapperChannelHolder.h) and the support tests that use them directly import under __has_include, so the code builds against both the 7.0 betas and GA. No behaviour change. Co-Authored-By: Claude Opus 5.5 --- packages/react-native/ios/BugseeModule.mm | 5 +++++ .../BugseeRNSupport/include/BGSRNReportHandlerBridge.h | 5 +++++ .../Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h | 5 +++++ .../BugseeRNSupport/include/BGSRNWrapperChannelHolder.h | 5 +++++ .../ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h | 5 +++++ .../BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m | 5 +++++ .../BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m | 5 +++++ 7 files changed, 35 insertions(+) diff --git a/packages/react-native/ios/BugseeModule.mm b/packages/react-native/ios/BugseeModule.mm index 5a7c5014..fd0bda01 100644 --- a/packages/react-native/ios/BugseeModule.mm +++ b/packages/react-native/ios/BugseeModule.mm @@ -7,6 +7,11 @@ // with "use of '@import' when C++ modules are disabled", and then with a // cascade of undeclared identifiers that hides the real cause. #import +// 7.0 GA moves the wrapper contract to the Bugsee.SPI submodule (BugseeSPI.h); +// the 7.0 betas declare it in Bugsee.h. +#if __has_include() +#import +#endif #import #import diff --git a/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h b/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h index 8f0353ce..4894040c 100644 --- a/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h +++ b/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h @@ -2,6 +2,11 @@ // Not `@import Bugsee;`: this header is included from ObjC++, where C++ modules // are off on both delivery paths and a module import is a hard error. #import +// 7.0 GA moves the wrapper contract to the Bugsee.SPI submodule (BugseeSPI.h); +// the 7.0 betas declare it in Bugsee.h. +#if __has_include() +#import +#endif NS_ASSUME_NONNULL_BEGIN diff --git a/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h b/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h index 69ae81ec..6fa03b18 100644 --- a/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h +++ b/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h @@ -2,6 +2,11 @@ // Not `@import Bugsee;`: this header is included from ObjC++, where C++ modules // are off on both delivery paths and a module import is a hard error. #import +// 7.0 GA moves the wrapper contract to the Bugsee.SPI submodule (BugseeSPI.h); +// the 7.0 betas declare it in Bugsee.h. +#if __has_include() +#import +#endif NS_ASSUME_NONNULL_BEGIN diff --git a/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h b/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h index 7d8b93a7..ba821c17 100644 --- a/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h +++ b/packages/react-native/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h @@ -2,6 +2,11 @@ // Not `@import Bugsee;`: this header is included from ObjC++, where C++ modules // are off on both delivery paths and a module import is a hard error. #import +// 7.0 GA moves the wrapper contract to the Bugsee.SPI submodule (BugseeSPI.h); +// the 7.0 betas declare it in Bugsee.h. +#if __has_include() +#import +#endif NS_ASSUME_NONNULL_BEGIN diff --git a/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h b/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h index 2aa9b51c..fd96731d 100644 --- a/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h +++ b/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h @@ -1,5 +1,10 @@ @import Foundation; @import Bugsee; +// 7.0 GA moves the wrapper contract to the Bugsee.SPI submodule (BugseeSPI.h); +// the 7.0 betas declare it in Bugsee.h. +#if __has_include() +#import +#endif NS_ASSUME_NONNULL_BEGIN diff --git a/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m b/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m index d7122d26..53b0204f 100644 --- a/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m +++ b/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m @@ -1,5 +1,10 @@ @import XCTest; @import Bugsee; +// 7.0 GA moves the wrapper contract to the Bugsee.SPI submodule (BugseeSPI.h); +// the 7.0 betas declare it in Bugsee.h. +#if __has_include() +#import +#endif @import BugseeRNSupport; #import "BGSRNFakeReport.h" diff --git a/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m b/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m index e3e5764c..f228cb7d 100644 --- a/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m +++ b/packages/react-native/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m @@ -1,5 +1,10 @@ @import XCTest; @import Bugsee; +// 7.0 GA moves the wrapper contract to the Bugsee.SPI submodule (BugseeSPI.h); +// the 7.0 betas declare it in Bugsee.h. +#if __has_include() +#import +#endif @import BugseeRNSupport; /// Records every call it receives. Implements every optional channel method, From fd0f5bdfc8889dc2771d45e1ddfc04d49943abee Mon Sep 17 00:00:00 2001 From: Denis Sheikherev Date: Thu, 29 Oct 2026 19:05:20 +0700 Subject: [PATCH 2/2] Enum parity: drop the iOS IssueType check, the enum is gone in 7.0 GA The iOS SDK never used BGSIssueType (a report's type reaches BGSReportContract.type as the string "bug", "crash" or "error"), and 7.0 GA deletes it from BGSContracts.h. cli-extract-option-keys.ts read it from that header, so regenerating ios-enums.json against GA would throw. The extraction, the fixture entry and the parity test for it go; the IssueSeverity and CrashHandlerType checks stay. Against a 7.0 beta source tree the extraction simply no longer reads the enum. Co-Authored-By: Claude Opus 5.5 --- .../react-native/src/options/ios-enums.json | 5 ---- scripts/__tests__/enum-parity.test.ts | 23 +++---------------- scripts/cli-extract-option-keys.ts | 1 - 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/packages/react-native/src/options/ios-enums.json b/packages/react-native/src/options/ios-enums.json index 412e2e49..fc9f5b0c 100644 --- a/packages/react-native/src/options/ios-enums.json +++ b/packages/react-native/src/options/ios-enums.json @@ -6,11 +6,6 @@ "BugseeSeverityCritical": 4, "BugseeSeverityBlocker": 5 }, - "IssueType": { - "BGSIssueTypeBug": 0, - "BGSIssueTypeCrash": 1, - "BGSIssueTypeError": 2 - }, "CrashHandlerType": { "BugseeCrashHandlerTypeBSD": 1, "BugseeCrashHandlerTypeMach": 2, diff --git a/scripts/__tests__/enum-parity.test.ts b/scripts/__tests__/enum-parity.test.ts index cc6f0f85..05d5c87f 100644 --- a/scripts/__tests__/enum-parity.test.ts +++ b/scripts/__tests__/enum-parity.test.ts @@ -20,7 +20,7 @@ import iosEnums from '../../packages/react-native/src/options/ios-enums.json'; /** iOS prefixes every member; Android's names are bare. */ const stripPrefix = (member: string): string => - member.replace(/^(?:BugseeSeverity|BGSIssueType)/, ''); + member.replace(/^BugseeSeverity/, ''); const byValue = (members: Record): Record => Object.fromEntries(Object.entries(members).map(([name, value]) => [value, name])); @@ -72,22 +72,5 @@ describe('IssueSeverity agrees across platforms', () => { }); }); -/** - * iOS declares this enum and uses it nowhere -- the type travels as an - * NSString on the internal request and never reaches BGSReportContract, so an - * iOS handler cannot tell a recovered crash from a bug report the user typed. - * Tracked as bugsee-cocoa#121. - * - * Pinned anyway, because the values already agree and that is worth keeping - * true: whichever representation lands, it will have to match these. - */ -describe('IssueType agrees across platforms', () => { - it('numbers Bug, Crash and Error identically', () => { - expect( - Object.fromEntries( - Object.entries(iosEnums.IssueType as Record) - .map(([member, value]) => [stripPrefix(member), value]), - ), - ).toEqual({ Bug: 0, Crash: 1, Error: 2 }); - }); -}); +// No IssueType check: the iOS SDK has no such enum from 7.0 GA. A report's type reaches +// BGSReportContract.type as the string "bug", "crash" or "error", as on Android. diff --git a/scripts/cli-extract-option-keys.ts b/scripts/cli-extract-option-keys.ts index 89eb9b2b..edb11546 100644 --- a/scripts/cli-extract-option-keys.ts +++ b/scripts/cli-extract-option-keys.ts @@ -62,7 +62,6 @@ writeFileSync(enumsOut, `${JSON.stringify(enums, null, 2)}\n`); // on every member; the parity gate strips the prefix and compares VALUES. const iosEnumHeaders = { IssueSeverity: ['BugseeConstants.h', 'BugseeSeverityLevel'], - IssueType: ['BGSContracts.h', 'BGSIssueType'], CrashHandlerType: ['BugseeConstants.h', 'BugseeCrashHandlerType'], } as const; const iosEnums = Object.fromEntries(