fix(deploy): compare samplingRate as number in dirty detection
Drop the Number.isInteger normalization hack in useDeploymentPageState that mapped 1.0 → "1.0" but broke for values like 1.10 (which round-trip to 1.1). Instead, useFormDirty now parseFloats samplingRate on both sides before comparing, so "1", "1.0", and "1.00" all compare equal regardless of how the backend serializes the number. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,7 @@ export function useDeploymentPageState(
|
||||
metricsEnabled: agentConfig?.metricsEnabled ?? defaultForm.monitoring.metricsEnabled,
|
||||
metricsInterval: defaultForm.monitoring.metricsInterval,
|
||||
samplingRate: agentConfig?.samplingRate !== undefined
|
||||
? (Number.isInteger(agentConfig.samplingRate) ? `${agentConfig.samplingRate}.0` : String(agentConfig.samplingRate))
|
||||
? String(agentConfig.samplingRate)
|
||||
: defaultForm.monitoring.samplingRate,
|
||||
compressSuccess: agentConfig?.compressSuccess ?? defaultForm.monitoring.compressSuccess,
|
||||
replayEnabled: defaultForm.monitoring.replayEnabled,
|
||||
|
||||
Reference in New Issue
Block a user