moonming opened a new pull request, #3422:
URL: https://github.com/apache/apisix-dashboard/pull/3422

   ## What
   
   The Admin Key field in the settings modal fired 
`queryClient.invalidateQueries()` + `queryClient.refetchQueries()` on **every 
keystroke** (inside a bare `setTimeout`). Typing a 32-char admin key = 32 full 
invalidate+refetch storms of every mounted query, usually against a 401-ing 
backend. While reviewing this live I captured an 18-request burst of identical 
`GET /services` calls from one typing session.
   
   ## How
   
   - keep the per-keystroke jotai atom update (controlled input; the axios 
request interceptor reads the atom)
   - debounce the query refresh with `useDebouncedCallback` (@mantine/hooks, 
already a dependency) at 500ms — one refresh when the user pauses, same 
recovery behavior for paste and for the auth e2e flow
   
   ## Verification
   
   - new regression e2e 
`e2e/tests/regression/settings.admin-key-debounced-refetch.spec.ts`: types the 
key character-by-character (30ms delay), waits for the request count to settle, 
asserts the Admin API request count stays far below one-refetch-per-keystroke
   - `auth.spec.ts` passes unchanged (fill + reload flow unaffected)
   - `pnpm lint` clean, `tsc -b` clean
   
   Found during the review tracked in #3417.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to