Skip to content

Commit 36c19be

Browse files
committed
fix(ios): narrow device provisioning diagnosis
1 parent 08049c5 commit 36c19be

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

‎src/platforms/__tests__/boot-diagnostics.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ test('a provisioning failure is not treated as retryable infrastructure', () =>
9090
assert.equal(isInfrastructureBootFailureReason('IOS_RUNNER_DEVICE_NOT_PROVISIONED'), false);
9191
});
9292

93+
test.each([
94+
'Provisioning profile "Agent Device" has expired.',
95+
'Failed to install embedded profile: signing certificate is not valid.',
96+
])('does not mistake an unrelated signing failure for an unregistered device: %s', (stderr) => {
97+
const reason = classifyBootFailure({
98+
message: 'Runner did not accept connection (xcodebuild exited early)',
99+
stderr,
100+
context: { platform: 'ios', phase: 'connect' },
101+
});
102+
103+
assert.equal(reason, 'BOOT_COMMAND_FAILED');
104+
});
105+
93106
test('still classifies a genuine runner connect timeout as such', () => {
94107
assert.equal(
95108
classifyBootFailure({

‎src/platforms/boot-diagnostics.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ export function classifyBootFailure(input: {
7373
.toLowerCase();
7474

7575
// Matched before the connect-timeout branch: a runner that could not be
76-
// installed also never accepts a connection, and the timeout reading would
77-
// send the user to look at the screen or the network instead of the signing
78-
// account. Anchored on the CoreDevice error code and the English framework
79-
// strings, because the surrounding installer prose is localized.
76+
// installed also never accepts a connection. The stable CoreDevice code is
77+
// specific to a profile that does not cover the target device; generic
78+
// profile text also appears for unrelated signing failures.
79+
if (platform === 'ios' && haystack.includes('0xe8008012')) {
80+
return 'IOS_RUNNER_DEVICE_NOT_PROVISIONED';
81+
}
8082
if (
8183
platform === 'ios' &&
82-
(haystack.includes('0xe8008012') ||
83-
haystack.includes('provisioning profile') ||
84-
haystack.includes('embedded profile'))
84+
(haystack.includes('provisioning profile') || haystack.includes('embedded profile'))
8585
) {
86-
return 'IOS_RUNNER_DEVICE_NOT_PROVISIONED';
86+
return 'BOOT_COMMAND_FAILED';
8787
}
8888
if (
8989
platform === 'ios' &&

0 commit comments

Comments
 (0)