Skip to content

Reapply "ref(dynamic-sampling): Migrate organizationSampling to new form system (#109356)"#111612

Merged
priscilawebdev merged 1 commit into
masterfrom
chromy/2026-03-26-reland
Mar 27, 2026
Merged

Reapply "ref(dynamic-sampling): Migrate organizationSampling to new form system (#109356)"#111612
priscilawebdev merged 1 commit into
masterfrom
chromy/2026-03-26-reland

Conversation

@chromy
Copy link
Copy Markdown
Contributor

@chromy chromy commented Mar 26, 2026

This reverts commit 73dde1f.

@chromy chromy requested a review from a team as a code owner March 26, 2026 13:23
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 26, 2026
Copy link
Copy Markdown
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.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

});
addSuccessMessage(t('Changes applied.'));
setSavedTargetSampleRate(value.targetSampleRate);
formApi.reset(value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dual source of truth causes stale UI after save

Medium Severity

After a successful save, savedTargetSampleRate is set from the user's raw input (e.g., "30"), but the org store update causes initialTargetSampleRate to be recomputed as (0.3 * 100).toString(), which yields "30.000000000000004" due to IEEE 754 floating-point arithmetic. Because TanStack Form's defaultValues are reactive, the form's current value gets overwritten with the floating-point-noisy string. This causes showPreviousValue (targetSampleRate !== savedTargetSampleRate) to evaluate true incorrectly, displaying a spurious "previous value" indicator and a noisy number in the input. Affects common rates like 10%, 20%, 30%, 60%, 70%.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member

@priscilawebdev priscilawebdev left a comment

Choose a reason for hiding this comment

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

🙌

@priscilawebdev priscilawebdev merged commit e7aa611 into master Mar 27, 2026
71 checks passed
@priscilawebdev priscilawebdev deleted the chromy/2026-03-26-reland branch March 27, 2026 07:55
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 11, 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