fix(connect): explain DPoP connection failures #8351
Mergedextoci(GitHub profile, opens in a new tab)merged 10 commits into
main fromrefs/pull/8351/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx lines 234 to 236OutdatedResolvedby juliusmarminge@@ -229,4 +232,5 @@229232 </div>230233 <p231234 className={cn(232- "mt-1 truncate text-xs",235+ "mt-1 text-xs",236+ statusHasHint ? "whitespace-pre-line break-words" : "truncate",apps/web/src/components/settings/ConnectionsSettings.tsx lines 1467 to 1476OutdatedResolvedby juliusmarminge@@ -1464,4 +1464,13 @@14641464 ) : null}14651465 {environment.connection.error && !resumingServerUpdate ? (14661466 <p className="flex min-w-0 items-center gap-2 text-destructive text-xs">1467- <span className="truncate">{connectionStatusText(environment.connection)}</span>1467+ <span1468+ className={cn(1469+ "min-w-0",1470+ connectionStatusText(environment.connection).includes("\n")1471+ ? "whitespace-pre-line break-words"1472+ : "truncate",1473+ )}1474+ >1475+ {connectionStatusText(environment.connection)}1476+ </span>
- apps/web/src/components/clerk/T3ConnectUserProfilePage.tsx lines 219 to 221OutdatedResolvedby juliusmarminge@@ -216,4 +216,6 @@216216 <p className="font-medium text-destructive-foreground">217217 Could not load T3 Connect environments218218 </p>219- <p className="mt-1 text-xs text-muted-foreground">{environmentsState.error}</p>219+ <p className="mt-1 whitespace-pre-line break-words text-xs text-muted-foreground">220+ {environmentsState.error}221+ </p>apps/web/src/components/settings/ConnectionsSettings.tsx lines 1467 to 1476OutdatedResolvedby juliusmarminge@@ -1464,4 +1464,13 @@14641464 ) : null}14651465 {environment.connection.error && !resumingServerUpdate ? (14661466 <p className="flex min-w-0 items-center gap-2 text-destructive text-xs">1467- <span className="truncate">{connectionStatusText(environment.connection)}</span>1467+ <span1468+ className={cn(1469+ "min-w-0",1470+ connectionStatusText(environment.connection).includes("\n")1471+ ? "whitespace-pre-line break-words"1472+ : "truncate",1473+ )}1474+ >1475+ {connectionStatusText(environment.connection)}1476+ </span>
- apps/web/src/cloud/linkEnvironment.ts lines 27 to 27Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -19,10 +19,9 @@1919 type RelayClientDeviceRecord,2020 type RelayClientEnvironmentRecord,2121 type RelayEnvironmentLinkResponse,22- type RelayProtectedError as RelayProtectedErrorType,2322 type RelayManagedEndpointProviderKind,2423 } from "@t3tools/contracts/relay";2524 import { EnvironmentRegistry } from "@t3tools/client-runtime/connection";2625 import { request, runStream } from "@t3tools/client-runtime/rpc";2726 import { makeEnvironmentHttpApiClient } from "@t3tools/client-runtime/rpc";28-import { ManagedRelay } from "@t3tools/client-runtime/relay";27+import { ManagedRelay, relayProtectedErrorMessage } from "@t3tools/client-runtime/relay";
- apps/mobile/src/features/connection/CloudEnvironmentRows.tsx line 354OutdatedResolvedby extoci(GitHub profile, opens in a new tab)@@ -350,4 +351,4 @@350351 >351352 <Text352353 className={cn("min-w-0 flex-1 text-xs", statusClassName)}353- numberOfLines={isErrorExpanded ? undefined : 1}354+ numberOfLines={isErrorExpanded || statusHasHint ? undefined : 1}
juliusmarminge merged this94f1948
juliusmarminge closed this
Sign in to join this conversation.
📝 Walkthrough
Walkthrough#
The change adds structured DPoP failure codes and propagates safe failure reasons through relay and environment authentication. Client error mapping now selects clock or retry hints. Mobile and web interfaces preserve multiline troubleshooting text.
Changes#
DPoP diagnostics and error presentation
packages/contracts/...,packages/shared/src/dpop*infra/relay/src/auth/*,infra/relay/src/http/*,apps/server/src/auth/*,apps/server/src/http.ts,apps/server/src/ws.ts,apps/server/src/server.test.tspackages/client-runtime/src/{authorization,connection,relay}/*,apps/mobile/src/features/cloud/linkEnvironment*,apps/web/src/cloud/linkEnvironment.tsapps/mobile/src/features/{connection,projects}/*,apps/web/src/components/*,docs/*Estimated code review effort: 4 (Complex) | ~45 minutes
Merge Risk: 🔵 Low · up to
d479fThe PR preserves authentication denials and adds clearer DPoP diagnostics, but mobile hint rows can still show an expandable chevron even when their full message is already visible, leading to a confusing no-op tap. This is a localized, low-risk follow-up item rather than a merge blocker.
Sequence Diagram(s)#
Suggested reviewers:
juliusmarminge,t3dotgg🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 5.26% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 42 files. (4 skipped: 4 unsupported.)
Full details: Description check
Explanation
The description clearly covers the problem, implementation, compatibility, validation, tests, documentation, and observability changes. It does not use the template's exact headings, omit a checklist, and provide before/after screenshots for the UI changes, but the required context is mostly complete.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.