DSingh0304 commented on PR #3295:
URL: 
https://github.com/apache/apisix-dashboard/pull/3295#issuecomment-4108476948

   The CI was failing primarily due to a synchronization race condition in the 
dynamic Upstream Nodes form and missing UI state initialization during resource 
updates.
   
   In the FormItemNodes component (Upstream Nodes table), field values were 
being synced to the main form only on "blur" or "click outside" events. 
High-speed E2E tests often clicked the "Submit" button before these events 
could trigger, resulting in empty or stale data being sent.
   
   When editing existing Routes/Services, internal UI flags (like 
__checksEnabled) used to manage form sections were not initialized from the 
backend data, causing validation to fail or sections to be hidden incorrectly.
   
   Additionally, sending empty nested objects (e.g., timeout: {}) caused schema 
rejection on the APISIX backend.
   
   Fix Details:
   
   Real time Sync: Refactored FormItemNodes.tsx to sync with the form state 
immediately on every keystroke (onChange) and row operation (Add/Delete), 
ensuring the form state is always up-to-date before submission.
   
   UI State Hydration: Introduced produceToNestedUpstreamForm to correctly map 
backend API responses to the dashboard's internal UI-specific form structure, 
ensuring toggles and section states are restored on edit.
   
   Recursive Sanitization: Enhanced the data pipeline with 
produceRmEmptyUpstreamFields to recursively prune empty nested objects before 
they reach the backend, preventing schema validation errors.
   
   Stability: Adjusted Monaco Editor mounting in Editor.tsx to allow test 
environment access during development mode, improving E2E stability.


-- 
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