Skip to content

Commit a9d92d5

Browse files
V48 (impl-only): Fix auxillaries data + VCS card tests after GitHub fixes
Safely refresh connection without requiring manager.getConnection; update regeneration diagnostic copy assertions for the single shared GitHub App.
1 parent 5a30d9e commit a9d92d5

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

uapi/app/api/auxillaries/data/route.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@ const getAuxillaryData = buildGetAuxillaryDataRoute({
4747
});
4848

4949
// Prefer post-validation connection row (may include regeneration diagnostics).
50-
const refreshedConnection = valid
51-
? (await manager.getConnection(userId, 'github').catch(() => null)) || connection
52-
: (await manager.getConnection(userId, 'github').catch(() => null)) || connection;
50+
// getConnection is optional on lightweight managers in tests — never throw.
51+
let refreshedConnection = connection;
52+
try {
53+
if (manager && typeof manager.getConnection === 'function') {
54+
refreshedConnection =
55+
(await manager.getConnection(userId, 'github')) || connection;
56+
}
57+
} catch {
58+
refreshedConnection = connection;
59+
}
5360

5461
return {
5562
repositoryConnectionStatus: buildStoredConnectionStatus(

uapi/tests/vcsConnectionCard.test.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ describe("VCSConnectionCard — regeneration-failure diagnostic (V48-Gate3-F34)"
5555
screen.getByText(/Failed to generate installation token: 404 Not Found/i),
5656
).toBeInTheDocument();
5757
expect(
58-
screen.getByText(/Try Disconnect below, then reconnect/i),
58+
screen.getByText(/bitcode-github-auxiliary/i),
59+
).toBeInTheDocument();
60+
expect(
61+
screen.getByText(/Try Disconnect, then Install GitHub App again/i),
5962
).toBeInTheDocument();
6063
});
6164

@@ -76,7 +79,7 @@ describe("VCSConnectionCard — regeneration-failure diagnostic (V48-Gate3-F34)"
7679
screen.getByText(/GitHub App credentials are not configured/i),
7780
).toBeInTheDocument();
7881
expect(
79-
screen.queryByText(/Try Disconnect below, then reconnect/i),
82+
screen.queryByText(/Try Disconnect, then Install GitHub App again/i),
8083
).not.toBeInTheDocument();
8184
});
8285

0 commit comments

Comments
 (0)