Skip to content

ref(relay): Migrate ingestThroughTrustedRelaysOnly to AutoSaveField#108761

Merged
JonasBa merged 8 commits intomasterfrom
ref/migrate-relay-form-to-tanstack
Feb 25, 2026
Merged

ref(relay): Migrate ingestThroughTrustedRelaysOnly to AutoSaveField#108761
JonasBa merged 8 commits intomasterfrom
ref/migrate-relay-form-to-tanstack

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Feb 20, 2026

Migrate the `ingestThroughTrustedRelaysOnly` toggle in the relay settings page from the deprecated `Form`/`JsonForm` pattern to the new `AutoSaveField` from `@sentry/scraps/form`.

The old system used a JSON-driven field config with `getData` to convert the boolean toggle value to the `'enabled'`/`'disabled'` string the API expects. The new system uses a Zod schema and handles the transformation in `mutationFn` instead.

Also adds `ingestThroughTrustedRelaysOnly` to the Organization frontend type, which was previously missing, and adds a test suite covering the feature flag gate, initial value mapping, confirm modal behaviour (enable-only), cancel/revert, disable path, API error revert, and permission-based disabling.

Refs DE-946

Replace the deprecated Form/JsonForm pattern in the relay settings page
with the new AutoSaveField from @sentry/scraps/form. The toggle now uses
a Zod schema and mutationFn to handle the boolean-to-string conversion
for the API instead of getData.

Also adds ingestThroughTrustedRelaysOnly to the Organization frontend
type (was missing entirely) and adds a test suite covering the feature
flag gate, initial value mapping, confirm modal, cancel behaviour,
disable path, API error revert, and permission-based disabling.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 20, 2026
visible: organization.features.includes(
'ingest-through-trusted-relays-only'
),
getData: (data: Record<string, any>) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful type cast... This field was never actually typed on the organization...

@JonasBa JonasBa changed the title ref(settings): migrate ingestThroughTrustedRelaysOnly form ref(relay): Migrate ingestThroughTrustedRelaysOnly to AutoSaveField Feb 20, 2026
@linear
Copy link

linear bot commented Feb 20, 2026

DE-946 Migrate relay

@JonasBa JonasBa requested a review from a team February 24, 2026 18:40
JonasBa and others added 2 commits February 24, 2026 11:22
…Only mutation and restore console spy in tests

Add onSuccess callback to AutoSaveField mutationOptions to update
OrganizationStore when ingestThroughTrustedRelaysOnly toggle is saved,
preventing stale data when the component re-mounts.

Also restore the console.error spy in the test to avoid suppressing
errors in subsequent tests.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Dominik Dorfmeister <dominik.dorfmeister@sentry.io>
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@JonasBa JonasBa merged commit 2e48007 into master Feb 25, 2026
63 checks passed
@JonasBa JonasBa deleted the ref/migrate-relay-form-to-tanstack branch February 25, 2026 16:17
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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