Prevent developer page tests from affecting resource health metrics#398
Prevent developer page tests from affecting resource health metrics#398Trynax wants to merge 2 commits intoMerit-Systems:mainfrom
Conversation
…fecting resource health metrics
|
@Trynax is attempting to deploy a commit to the Merit Systems Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Additional Suggestion:
The skipTracking prop received by the Form component is never passed to the ResourceFetch component, causing test executions from the developer form to still be tracked in analytics despite the intent to skip tracking.
View Details
📝 Patch Details
diff --git a/apps/scan/src/app/_components/resources/executor/form/index.tsx b/apps/scan/src/app/_components/resources/executor/form/index.tsx
index 1f0a9c82..273ebe4d 100644
--- a/apps/scan/src/app/_components/resources/executor/form/index.tsx
+++ b/apps/scan/src/app/_components/resources/executor/form/index.tsx
@@ -232,6 +232,7 @@ export function Form({
onSuccess: data => setData(data),
onError: error => setError(error),
}}
+ skipTracking={skipTracking}
/>
{error && (
Analysis
Missing skipTracking prop propagation in ResourceFetch component
What fails: The Form component in apps/scan/src/app/_components/resources/executor/form/index.tsx receives a skipTracking prop (line 55) but fails to pass it to the ResourceFetch component (lines 219-235), preventing the skip_tracking query parameter from being added to proxy requests.
How to reproduce:
- Create a component that uses the Form component with
skipTracking={true} - Make a request through the form
- Inspect the proxy URL generated by fetchWithProxy - it will not contain
skip_tracking=truequery parameter - The request will be tracked in analytics (ClickHouse) despite the intention to skip tracking
Result: ResourceFetch is invoked without the skipTracking prop, causing it to default to false and resulting in all requests being tracked regardless of the caller's intent.
Expected: The skipTracking prop should be passed through the entire component hierarchy: Form → ResourceFetch → FetchEvm/FetchSvm → useEvmX402Fetch/useSvmX402Fetch → useX402Fetch → fetchWithProxy, ultimately appending skip_tracking=true to the proxy URL query parameters.
Fix applied: Added skipTracking={skipTracking} to the ResourceFetch component props on line 235 of apps/scan/src/app/_components/resources/executor/form/index.tsx. This completes the prop propagation chain, allowing the skip_tracking parameter to be correctly appended to proxy requests when the Form component is used with skipTracking={true}.
This PR adds
skip_trackingparameter to prevent developer page endpoint tests from being recorded in analytics, ensuring they don't affect resource health status calculations.