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, 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(