Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/react-native/ios/BugseeModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Bugsee/Bugsee.h>
// 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(<Bugsee/BugseeSPI.h>)
#import <Bugsee/BugseeSPI.h>
#endif
#import <UIKit/UIKit.h>
#import <os/lock.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Bugsee/Bugsee.h>
// 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(<Bugsee/BugseeSPI.h>)
#import <Bugsee/BugseeSPI.h>
#endif

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Bugsee/Bugsee.h>
// 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(<Bugsee/BugseeSPI.h>)
#import <Bugsee/BugseeSPI.h>
#endif

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Bugsee/Bugsee.h>
// 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(<Bugsee/BugseeSPI.h>)
#import <Bugsee/BugseeSPI.h>
#endif

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
@@ -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(<Bugsee/BugseeSPI.h>)
#import <Bugsee/BugseeSPI.h>
#endif

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
@@ -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(<Bugsee/BugseeSPI.h>)
#import <Bugsee/BugseeSPI.h>
#endif
@import BugseeRNSupport;

#import "BGSRNFakeReport.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -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(<Bugsee/BugseeSPI.h>)
#import <Bugsee/BugseeSPI.h>
#endif
@import BugseeRNSupport;

/// Records every call it receives. Implements every optional channel method,
Expand Down
5 changes: 0 additions & 5 deletions packages/react-native/src/options/ios-enums.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"BugseeSeverityCritical": 4,
"BugseeSeverityBlocker": 5
},
"IssueType": {
"BGSIssueTypeBug": 0,
"BGSIssueTypeCrash": 1,
"BGSIssueTypeError": 2
},
"CrashHandlerType": {
"BugseeCrashHandlerTypeBSD": 1,
"BugseeCrashHandlerTypeMach": 2,
Expand Down
23 changes: 3 additions & 20 deletions scripts/__tests__/enum-parity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, number>): Record<number, string> =>
Object.fromEntries(Object.entries(members).map(([name, value]) => [value, name]));
Expand Down Expand Up @@ -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<string, number>)
.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.
1 change: 0 additions & 1 deletion scripts/cli-extract-option-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading