Skip to content

fix(relay): Make trustedRelays optional on Organization type#116014

Merged
TkDodo merged 1 commit into
masterfrom
tkdodo/fix/de-1265-typeerror-cannot-read-properties-of-undefined-reading-length
May 21, 2026
Merged

fix(relay): Make trustedRelays optional on Organization type#116014
TkDodo merged 1 commit into
masterfrom
tkdodo/fix/de-1265-typeerror-cannot-read-properties-of-undefined-reading-length

Conversation

@TkDodo
Copy link
Copy Markdown
Collaborator

@TkDodo TkDodo commented May 21, 2026

The Organization TypeScript type declared trustedRelays as a required Relay[], but the backend's OrganizationSummarySerializer (used when detailed=0 and the user lacks org:read) does not include this field. This caused a runtime crash (Cannot read properties of undefined (reading 'length')) on the Relay settings page.

Mark trustedRelays as optional on the Organization type and add nullish coalescing fallbacks in the relay wrapper component.

fixes JAVASCRIPT-39V9

The OrganizationSummarySerializer (used when detailed=0 and the user
lacks org:read) does not include trustedRelays, but the TypeScript
type declared it as required. This mismatch caused a runtime crash
when accessing trustedRelays.length on the Relay settings page.

Mark trustedRelays as optional on the Organization type and add
nullish coalescing fallbacks in the relay wrapper component.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 21, 2026

DE-1265

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 21, 2026
@TkDodo TkDodo marked this pull request as ready for review May 21, 2026 16:12
@TkDodo TkDodo requested a review from a team as a code owner May 21, 2026 16:12
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.60%

@TkDodo TkDodo merged commit 5b8c1da into master May 21, 2026
73 checks passed
@TkDodo TkDodo deleted the tkdodo/fix/de-1265-typeerror-cannot-read-properties-of-undefined-reading-length branch May 21, 2026 17:38
natemoo-re pushed a commit that referenced this pull request May 21, 2026
The `Organization` TypeScript type declared `trustedRelays` as a
required `Relay[]`, but the backend's `OrganizationSummarySerializer`
(used when `detailed=0` and the user lacks `org:read`) does not include
this field. This caused a runtime crash (`Cannot read properties of
undefined (reading 'length')`) on the Relay settings page.

Mark `trustedRelays` as optional on the `Organization` type and add
nullish coalescing fallbacks in the relay wrapper component.

fixes JAVASCRIPT-39V9

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants