ref(relay): Migrate ingestThroughTrustedRelaysOnly to AutoSaveField#108761
Merged
ref(relay): Migrate ingestThroughTrustedRelaysOnly to AutoSaveField#108761
Conversation
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>
JonasBa
commented
Feb 20, 2026
| visible: organization.features.includes( | ||
| 'ingest-through-trusted-relays-only' | ||
| ), | ||
| getData: (data: Record<string, any>) => { |
Member
Author
There was a problem hiding this comment.
Beautiful type cast... This field was never actually typed on the organization...
static/app/views/settings/organizationRelay/relayWrapper.spec.tsx
Outdated
Show resolved
Hide resolved
…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>
TkDodo
approved these changes
Feb 25, 2026
TkDodo
reviewed
Feb 25, 2026
Co-authored-by: Dominik Dorfmeister <dominik.dorfmeister@sentry.io>
Contributor
There was a problem hiding this comment.
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.
static/app/views/settings/organizationRelay/relayWrapper.spec.tsx
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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