Re: [PR] fix: pass host reset [apisix-dashboard]

2026-05-19 Thread via GitHub


moonming merged PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-04-26 Thread via GitHub


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

   @Baoyuantop is this PR ready to be merged ?
   


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-04-13 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r3077553181


##
e2e/utils/ui/upstreams.ts:
##
@@ -52,10 +54,10 @@ export async function uiFillUpstreamRequiredFields(
   await firstRowHost.fill(upstream.nodes[1].host);
   await expect(firstRowHost).toHaveValue(upstream.nodes[1].host);
 
-  // Add second node - blur first, wait for useClickOutside state sync, then 
click Add
+  // Add second node - blur first to trigger sync, then click Add
   await firstRowHost.blur();
   if (page) await page.waitForTimeout(500);
-  await addNodeBtn.click();
+  await addNodeBtn.click({ force: true });

Review Comment:
   I added it because I encountered intermittent flakiness in CI where the 'Add 
a Node' button was visible but Playwright reported it as 'obstructed', likely 
due to a lingering animation from the Ant Design Table or a transitioning 
tooltip.



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-04-13 Thread via GitHub


LiteSun commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r3076639953


##
e2e/utils/ui/upstreams.ts:
##
@@ -52,10 +54,10 @@ export async function uiFillUpstreamRequiredFields(
   await firstRowHost.fill(upstream.nodes[1].host);
   await expect(firstRowHost).toHaveValue(upstream.nodes[1].host);
 
-  // Add second node - blur first, wait for useClickOutside state sync, then 
click Add
+  // Add second node - blur first to trigger sync, then click Add
   await firstRowHost.blur();
   if (page) await page.waitForTimeout(500);
-  await addNodeBtn.click();
+  await addNodeBtn.click({ force: true });

Review Comment:
   Why use force?



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-04-08 Thread via GitHub


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

   Hi @Baoyuantop all the checks pass can you please review this PR!!


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-04-03 Thread via GitHub


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

   Hi @Baoyuantop all the checks pass for this PR can you please review this, 
thank you.


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-27 Thread via GitHub


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

   The tests did not run due to lint failure which has been fixed now.


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-25 Thread via GitHub


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

   > I will go through the CI and fix it again.
   
   Tried fixing in 
[d138d9e](https://github.com/apache/apisix-dashboard/pull/3295/commits/d138d9e551d5f0486618ed5459446804bc50f400)
 


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-25 Thread via GitHub


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

   I will go through the CI and fix it again.


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-23 Thread via GitHub


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

   Hi @Baoyuantop I tried fixing the CI can you run the checks again


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-23 Thread via GitHub


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]



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-22 Thread via GitHub


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

   > Hi @DSingh0304, please fix failed CI
   
   Yes, I will fix the CI in a while.


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-22 Thread via GitHub


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

   Hi @DSingh0304, please fix failed CI


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-21 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2971170370


##
src/routes/upstreams/detail.$id.tsx:
##
@@ -68,11 +72,14 @@ const UpstreamDetailForm = (
 refetch,
   } = useSuspenseQuery(getUpstreamQueryOptions(id));
 
-  const form = useForm({
+  const formDefaults = produceToUpstreamForm(upstreamData) as 
FormPartUpstreamType;

Review Comment:
   Fixed in 
[e8e5fd7](https://github.com/apache/apisix-dashboard/pull/3295/commits/e8e5fd792b5d78632957f9ff1be24918cee0b167)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-21 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2971167530


##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { randomId } from '@e2e/utils/common';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams } from '@/apis/upstreams';
+
+test.beforeAll(async () => {
+  await deleteAllUpstreams(e2eReq);
+});

Review Comment:
   I must have missed it due to confusion, thank you for pointing it out. Fixed 
in 
[6e0093e](https://github.com/apache/apisix-dashboard/pull/3295/commits/6e0093e5349cec79f1498eaad373e98a023c03c5)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-21 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2971162731


##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -104,6 +99,20 @@ const StreamRouteDetailForm = (props: Props) => {
   );
 };
 
+const StreamRouteDetailForm = (props: Props) => {
+  return (
+https://github.com/apache/apisix-dashboard/pull/3295/commits/dac340cd49aa27ae6fb4958b5e94dde51ba7c680)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-21 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2971161417


##
src/routes/upstreams/detail.$id.tsx:
##
@@ -68,11 +72,14 @@ const UpstreamDetailForm = (
 refetch,
   } = useSuspenseQuery(getUpstreamQueryOptions(id));
 
-  const form = useForm({
+  const formDefaults = produceToUpstreamForm(upstreamData) as 
FormPartUpstreamType;
+  type FormPartUpstreamInput = z.input;
+  const form = useForm({
 resolver: zodResolver(FormPartUpstreamSchema),
 shouldUnregister: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: formDefaults,
   });
 
   const putUpstream = useMutation({

Review Comment:
   Addressed in 
[8e301b3](https://github.com/apache/apisix-dashboard/pull/3295/commits/8e301b3d1fd1e7c7638fc9d98ee187c7d400d3ea)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-21 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2971152067


##
src/routes/services/detail.$id/index.tsx:
##
@@ -53,21 +53,20 @@ const ServiceDetailForm = (props: Props) => {
   const { id } = useParams({ from: '/services/detail/$id' });
 
   const serviceQuery = useSuspenseQuery(getServiceQueryOptions(id));
-  const { data: serviceData, isLoading, refetch } = serviceQuery;
+  const { data: serviceData, refetch } = serviceQuery;
 
   const form = useForm({
 resolver: zodResolver(APISIX.Service),
 shouldUnregister: true,
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: serviceData.value,

Review Comment:
   Fixed in 
[401e258](https://github.com/apache/apisix-dashboard/pull/3295/commits/401e258cd6e360dfbb1661baf5f01b3ef938e00b)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-19 Thread via GitHub


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

   > Good root cause analysis — the `shouldUnregister: true` + missing 
`defaultValues` interaction is a classic react-hook-form pitfall and the fix 
direction is correct.
   > 
   > However there are a few issues that need to be addressed before this can 
be merged. See inline comments below.
   > 
   > **Summary:**
   > Category   Items
   > Must fix   Missing Suspense boundaries (services, upstreams), e2e 
`deleteAllUpstreams` still present
   > Suggestion Suspense fallback style inconsistency, consider 
`useMemo` for `formDefaults`
   
   Sure, I will go through the comments and apply the fix.


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-19 Thread via GitHub


Baoyuantop commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2959089268


##
src/routes/services/detail.$id/index.tsx:
##
@@ -53,21 +53,20 @@ const ServiceDetailForm = (props: Props) => {
   const { id } = useParams({ from: '/services/detail/$id' });
 
   const serviceQuery = useSuspenseQuery(getServiceQueryOptions(id));
-  const { data: serviceData, isLoading, refetch } = serviceQuery;
+  const { data: serviceData, refetch } = serviceQuery;
 
   const form = useForm({
 resolver: zodResolver(APISIX.Service),
 shouldUnregister: true,
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: serviceData.value,

Review Comment:
   **[must-fix] Missing Suspense boundary**
   
   This file uses `useSuspenseQuery` but has no `` boundary wrapping 
`ServiceDetailForm`. The PR also removes the `isLoading` / `` 
fallback.
   
   Without a local Suspense boundary, React will bubble up to the nearest 
ancestor boundary (likely the router level), which may result in a blank area 
or full-page loading spinner — a UX regression.
   
   Route detail and Stream Route detail both got Suspense boundaries in this 
PR. Service detail should be consistent.
   
   ```tsx
   // In RouteComponent, wrap ServiceDetailForm similar to how RouteDetail does 
it:
   
 
   
 }
   >
 
   
 
   
   ```



##
src/routes/upstreams/detail.$id.tsx:
##
@@ -68,11 +72,14 @@ const UpstreamDetailForm = (
 refetch,
   } = useSuspenseQuery(getUpstreamQueryOptions(id));
 
-  const form = useForm({
+  const formDefaults = produceToUpstreamForm(upstreamData) as 
FormPartUpstreamType;
+  type FormPartUpstreamInput = z.input;
+  const form = useForm({
 resolver: zodResolver(FormPartUpstreamSchema),
 shouldUnregister: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: formDefaults,
   });
 
   const putUpstream = useMutation({

Review Comment:
   **[must-fix] Missing Suspense boundary**
   
   Same issue as Service detail — `useSuspenseQuery` is used but no 
`` boundary wraps `UpstreamDetailForm` in the parent 
`RouteComponent`. The old `isLoading` / `` guard was removed on 
master but no Suspense fallback was added.
   
   Please add a `}>` wrapper 
around `` in `RouteComponent`, consistent with Route 
detail's pattern.



##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -104,6 +99,20 @@ const StreamRouteDetailForm = (props: Props) => {
   );
 };
 
+const StreamRouteDetailForm = (props: Props) => {
+  return (
+` as fallback (consistent with 
what was there before), but Stream Route detail uses `` with an inline `style={{ padding: 16 }}`.
   
   For consistency across detail pages, consider using the same `` 
pattern. The inline `style` prop is also uncommon in this codebase (Mantine 
style props like `p={16}` are preferred).
   
   ```tsx
   
 
   
 }
   >
   ```



##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { randomId } from '@e2e/utils/common';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams } from '@/apis/upstreams';
+
+test.beforeAll(async () => {
+  await deleteAllUpstreams(e2eReq);
+});

Review Comment:
   **[must-fix] `deleteAllUpstreams` still present — race condition risk**
   
   The Copilot reviewer flagged this and you marked it resolved, but 
`deleteAllUpstreams(e2eReq)` is still here in the final diff. With 
`fullyParallel: true`, this will nuke upstreams created by other parallel specs.
   
   The `routes.clear-upstream-field.spec.ts` changes in this same PR 
demonstrate the correct pattern — track created resource IDs and clean up only 
what you created in `afterEach`/`afterAll`.
   
   Since each test in this file already creates its own upstream with 
`randomId` and deletes it at the end via UI, you can likely just remove this 
`beforeAll` entirely. The tests ar

Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-19 Thread via GitHub


Baoyuantop commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2959089279


##
src/routes/upstreams/detail.$id.tsx:
##
@@ -68,11 +72,14 @@ const UpstreamDetailForm = (
 refetch,
   } = useSuspenseQuery(getUpstreamQueryOptions(id));
 
-  const form = useForm({
+  const formDefaults = produceToUpstreamForm(upstreamData) as 
FormPartUpstreamType;
+  type FormPartUpstreamInput = z.input;
+  const form = useForm({
 resolver: zodResolver(FormPartUpstreamSchema),
 shouldUnregister: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: formDefaults,
   });
 
   const putUpstream = useMutation({

Review Comment:
   **🔴 Missing Suspense boundary**
   
   Same issue as Service detail — `useSuspenseQuery` is used but no 
`` boundary wraps `UpstreamDetailForm` in the parent 
`RouteComponent`. The old `isLoading` / `` guard was removed on 
master but no Suspense fallback was added.
   
   Please add a `}>` wrapper 
around `` in `RouteComponent`, consistent with Route 
detail's pattern.



##
src/routes/services/detail.$id/index.tsx:
##
@@ -53,21 +53,20 @@ const ServiceDetailForm = (props: Props) => {
   const { id } = useParams({ from: '/services/detail/$id' });
 
   const serviceQuery = useSuspenseQuery(getServiceQueryOptions(id));
-  const { data: serviceData, isLoading, refetch } = serviceQuery;
+  const { data: serviceData, refetch } = serviceQuery;
 
   const form = useForm({
 resolver: zodResolver(APISIX.Service),
 shouldUnregister: true,
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: serviceData.value,

Review Comment:
   **🔴 Missing Suspense boundary**
   
   This file uses `useSuspenseQuery` but has no `` boundary wrapping 
`ServiceDetailForm`. The PR also removes the `isLoading` / `` 
fallback.
   
   Without a local Suspense boundary, React will bubble up to the nearest 
ancestor boundary (likely the router level), which may result in a blank area 
or full-page loading spinner — a UX regression.
   
   Route detail and Stream Route detail both got Suspense boundaries in this 
PR. Service detail should be consistent.
   
   ```tsx
   // In RouteComponent, wrap ServiceDetailForm similar to how RouteDetail does 
it:
   
 
   
 }
   >
 
   
 
   
   ```



##
src/routes/upstreams/detail.$id.tsx:
##
@@ -68,11 +72,14 @@ const UpstreamDetailForm = (
 refetch,
   } = useSuspenseQuery(getUpstreamQueryOptions(id));
 
-  const form = useForm({
+  const formDefaults = produceToUpstreamForm(upstreamData) as 
FormPartUpstreamType;

Review Comment:
   **🟡 Nit: `formDefaults` recomputed every render**
   
   `produceToUpstreamForm(upstreamData)` runs `produce()` (immer) on every 
render. While `defaultValues` is only consumed on first mount, the computation 
still runs. Consider wrapping in `useMemo`:
   
   ```ts
   const formDefaults = useMemo(
 () => produceToUpstreamForm(upstreamData) as FormPartUpstreamType,
 [upstreamData]
   );
   ```
   
   Same applies to the `formDefaults` computation in `routes/detail.$id.tsx`.



##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { randomId } from '@e2e/utils/common';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams } from '@/apis/upstreams';
+
+test.beforeAll(async () => {
+  await deleteAllUpstreams(e2eReq);
+});

Review Comment:
   **🔴 `deleteAllUpstreams` still present — race condition risk**
   
   The Copilot reviewer flagged this and you marked it resolved, but 
`deleteAllUpstreams(e2eReq)` is still here in the final diff. With 
`fullyParallel: true`, this will nuke upstreams created by other parallel specs.
   
   The `routes.clear-upstream-field.spec.ts` changes in this same PR 
demonstrate the correct pattern — track created resource IDs and clean up only 
what you created in `afterEach`/`afterAll`.
   
  

Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


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

   Hi @Baoyuantop  I have addressed the comments by copilot.


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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954947098


##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { randomId } from '@e2e/utils/common';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams } from '@/apis/upstreams';
+
+test.beforeAll(async () => {
+await deleteAllUpstreams(e2eReq);
+});

Review Comment:
   Fixed in 
[4d8d919](https://github.com/apache/apisix-dashboard/pull/3295/commits/4d8d919fb415be35421840a397041b595d0d0c9b)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954944718


##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -52,22 +52,21 @@ const StreamRouteDetailForm = (props: Props) => {
   const { readOnly, setReadOnly, id } = props;
   const { t } = useTranslation();
 
-  const streamRouteQuery = useQuery(getStreamRouteQueryOptions(id));
-  const { data: streamRouteData, isLoading, refetch } = streamRouteQuery;
+  const streamRouteQuery = useSuspenseQuery(getStreamRouteQueryOptions(id));
+  const { data: streamRouteData, refetch } = streamRouteQuery;

Review Comment:
   Fixed in 
[4d8d919](https://github.com/apache/apisix-dashboard/pull/3295/commits/4d8d919fb415be35421840a397041b595d0d0c9b)



##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -82,10 +81,6 @@ const StreamRouteDetailForm = (props: Props) => {
 },
   });
 
-  if (isLoading) {
-return ;
-  }
-
   return (

Review Comment:
   Fixed in 
[4d8d919](https://github.com/apache/apisix-dashboard/pull/3295/commits/4d8d919fb415be35421840a397041b595d0d0c9b)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954897451


##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 import { zodResolver } from '@hookform/resolvers/zod';
-import { Button, Group,Skeleton } from '@mantine/core';
+import { Button, Group } from '@mantine/core';
 import { notifications } from '@mantine/notifications';
-import { useMutation, useQuery } from '@tanstack/react-query';
+import { useMutation, useSuspenseQuery } from '@tanstack/react-query';

Review Comment:
   Fixed in 
[62a045d](https://github.com/apache/apisix-dashboard/pull/3295/commits/62a045d9cb6480227a083f5ef85884ba5a4c6eda)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


Copilot commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954492677


##
src/routes/services/detail.$id/index.tsx:
##
@@ -61,6 +61,7 @@ const ServiceDetailForm = (props: Props) => {
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: serviceData?.value,
   });

Review Comment:
   In `react-hook-form`, `defaultValues` are only applied on the initial 
`useForm` call; if `serviceData` is undefined on first render (common with 
non-suspense queries), this won’t actually seed defaults for later 
re-registrations, so it may not fully address the “reset to component 
defaultValue” issue described in the PR. A more reliable approach is to ensure 
defaults are set when data arrives (e.g., always `reset` with fetched values 
and let RHF update its internal defaults, or use RHF’s `values` option to 
reinitialize from fetched data), so re-registered fields consistently derive 
from fetched state rather than component-level defaults.



##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 import { zodResolver } from '@hookform/resolvers/zod';
-import { Button, Group,Skeleton } from '@mantine/core';
+import { Button, Group } from '@mantine/core';
 import { notifications } from '@mantine/notifications';
-import { useMutation, useQuery } from '@tanstack/react-query';
+import { useMutation, useSuspenseQuery } from '@tanstack/react-query';

Review Comment:
   Similar to the Route detail page, this removes the component’s `isLoading` 
Skeleton path and depends on Suspense for the loading state. Confirm that a 
Suspense fallback exists for this route so loading remains user-friendly and 
doesn’t regress to a blank render.



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954574335


##
src/routes/routes/detail.$id.tsx:
##
@@ -93,10 +97,6 @@ const RouteDetailForm = (props: Props) => {
 },
   });
 
-  if (isLoading) {
-return ;
-  }
-
   return (

Review Comment:
   Handled in latest revision 
[bf859db](https://github.com/apache/apisix-dashboard/pull/3295/commits/bf859db43f0d04d5d453799ffe491d200a1b093d):
 this route now has a local Suspense boundary with a Skeleton fallback around 
RouteDetailForm, so there is pending UI during initial load. 



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954566691


##
src/routes/routes/detail.$id.tsx:
##
@@ -59,26 +59,30 @@ const RouteDetailForm = (props: Props) => {
   const { readOnly, setReadOnly, id } = props;
   const { t } = useTranslation();
 
-  const routeQuery = useQuery(getRouteQueryOptions(id));
-  const { data: routeData, isLoading, refetch } = routeQuery;
+  const routeQuery = useSuspenseQuery(getRouteQueryOptions(id));
+  const { data: routeData, refetch } = routeQuery;

Review Comment:
   The current implementation already provides a route local pending UI. The 
proposed autofix is stale and not needed.



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954557826


##
src/routes/services/detail.$id/index.tsx:
##
@@ -61,6 +61,7 @@ const ServiceDetailForm = (props: Props) => {
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: serviceData?.value,
   });

Review Comment:
   fixed in 
[bf859db](https://github.com/apache/apisix-dashboard/pull/3295/commits/bf859db43f0d04d5d453799ffe491d200a1b093d)



##
src/routes/routes/detail.$id.tsx:
##
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 import { zodResolver } from '@hookform/resolvers/zod';
-import { Button, Group, Skeleton } from '@mantine/core';
+import { Button, Group } from '@mantine/core';
 import { notifications } from '@mantine/notifications';
-import { useMutation, useQuery } from '@tanstack/react-query';
+import { useMutation, useSuspenseQuery } from '@tanstack/react-query';

Review Comment:
   fixed in 
[bf859db](https://github.com/apache/apisix-dashboard/pull/3295/commits/bf859db43f0d04d5d453799ffe491d200a1b093d)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


Copilot commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954492784


##
src/routes/routes/detail.$id.tsx:
##
@@ -59,26 +59,30 @@ const RouteDetailForm = (props: Props) => {
   const { readOnly, setReadOnly, id } = props;
   const { t } = useTranslation();
 
-  const routeQuery = useQuery(getRouteQueryOptions(id));
-  const { data: routeData, isLoading, refetch } = routeQuery;
+  const routeQuery = useSuspenseQuery(getRouteQueryOptions(id));
+  const { data: routeData, refetch } = routeQuery;

Review Comment:
   This change removes the explicit in-component loading UI (Skeleton) and 
relies on React Suspense for data fetching. Please ensure there is a Suspense 
fallback/pending UI at the route/layout level for this screen; otherwise users 
may see a blank area (or an unhandled suspend) during initial load/refetch. If 
the router doesn’t provide a fallback here, reintroduce a localized fallback 
wrapper around the form content.



##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -52,22 +52,21 @@ const StreamRouteDetailForm = (props: Props) => {
   const { readOnly, setReadOnly, id } = props;
   const { t } = useTranslation();
 
-  const streamRouteQuery = useQuery(getStreamRouteQueryOptions(id));
-  const { data: streamRouteData, isLoading, refetch } = streamRouteQuery;
+  const streamRouteQuery = useSuspenseQuery(getStreamRouteQueryOptions(id));
+  const { data: streamRouteData, refetch } = streamRouteQuery;

Review Comment:
   Similar to the Route detail page, this removes the component’s `isLoading` 
Skeleton path and depends on Suspense for the loading state. Confirm that a 
Suspense fallback exists for this route so loading remains user-friendly and 
doesn’t regress to a blank render.



##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { randomId } from '@e2e/utils/common';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams } from '@/apis/upstreams';
+
+test.beforeAll(async () => {
+await deleteAllUpstreams(e2eReq);
+});
+
+/**
+ * Test for GitHub issue #3294
+ * Bug: pass_host is reset to default value "pass" when editing upstream nodes
+ * @see https://github.com/apache/apisix-dashboard/issues/3294
+ */
+test('should preserve pass_host value when editing upstream nodes', async ({
+page,
+}) => {

Review Comment:
   The new spec uses indentation that appears inconsistent with existing e2e 
tests in this repo (many use 2-space indentation). Running the repo’s formatter 
(e.g., Prettier) on this file will improve readability and reduce noisy diffs 
in future edits.



##
src/routes/routes/detail.$id.tsx:
##
@@ -93,10 +97,6 @@ const RouteDetailForm = (props: Props) => {
 },
   });
 
-  if (isLoading) {
-return ;
-  }
-
   return (

Review Comment:
   This change removes the explicit in-component loading UI (Skeleton) and 
relies on React Suspense for data fetching. Please ensure there is a Suspense 
fallback/pending UI at the route/layout level for this screen; otherwise users 
may see a blank area (or an unhandled suspend) during initial load/refetch. If 
the router doesn’t provide a fallback here, reintroduce a localized fallback 
wrapper around the form content.



##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is d

Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954435186


##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -61,6 +61,7 @@ const StreamRouteDetailForm = (props: Props) => {
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: streamRouteData?.value,
   });

Review Comment:
   Fixed in 
[fe7ce23](https://github.com/apache/apisix-dashboard/pull/3295/commits/fe7ce2369244aa7c5ec6478250f7dee628d538f7)



##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { randomId } from '@e2e/utils/common';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams } from '@/apis/upstreams';
+
+test.beforeAll(async () => {
+await deleteAllUpstreams(e2eReq);
+});

Review Comment:
   Fixed in 
[fe7ce23](https://github.com/apache/apisix-dashboard/pull/3295/commits/fe7ce2369244aa7c5ec6478250f7dee628d538f7)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-18 Thread via GitHub


DSingh0304 commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2954433497


##
src/routes/upstreams/detail.$id.tsx:
##
@@ -68,11 +71,14 @@ const UpstreamDetailForm = (
 refetch,
   } = useSuspenseQuery(getUpstreamQueryOptions(id));
 
-  const form = useForm({
-resolver: zodResolver(FormPartUpstreamSchema),
+  const formDefaults = produceToUpstreamForm(upstreamData) as 
FormPartUpstreamType;
+  const form = useForm({
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+resolver: zodResolver(FormPartUpstreamSchema) as any,
 shouldUnregister: true,

Review Comment:
   Fixed in 
[fe7ce23](https://github.com/apache/apisix-dashboard/pull/3295/commits/fe7ce2369244aa7c5ec6478250f7dee628d538f7)



##
src/routes/routes/detail.$id.tsx:
##
@@ -62,12 +62,20 @@ const RouteDetailForm = (props: Props) => {
   const routeQuery = useQuery(getRouteQueryOptions(id));
   const { data: routeData, isLoading, refetch } = routeQuery;
 
+  // Compute initial form values from route data
+  const formDefaults = routeData?.value
+? produceVarsToForm(
+  produceToUpstreamForm(routeData.value.upstream || {}, routeData.value)
+)
+: undefined;
+
   const form = useForm({
 resolver: zodResolver(RoutePutSchema),
 shouldUnregister: true,
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: formDefaults,
   });

Review Comment:
   Fixed in 
[fe7ce23](https://github.com/apache/apisix-dashboard/pull/3295/commits/fe7ce2369244aa7c5ec6478250f7dee628d538f7)



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



Re: [PR] fix: pass host reset [apisix-dashboard]

2026-03-10 Thread via GitHub


Copilot commented on code in PR #3295:
URL: https://github.com/apache/apisix-dashboard/pull/3295#discussion_r2911141617


##
src/routes/routes/detail.$id.tsx:
##
@@ -62,12 +62,20 @@ const RouteDetailForm = (props: Props) => {
   const routeQuery = useQuery(getRouteQueryOptions(id));
   const { data: routeData, isLoading, refetch } = routeQuery;
 
+  // Compute initial form values from route data
+  const formDefaults = routeData?.value
+? produceVarsToForm(
+  produceToUpstreamForm(routeData.value.upstream || {}, routeData.value)
+)
+: undefined;
+
   const form = useForm({
 resolver: zodResolver(RoutePutSchema),
 shouldUnregister: true,
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: formDefaults,
   });

Review Comment:
   `defaultValues` for `useForm` are only applied on the first render. Since 
this form is driven by `useQuery` (not suspense) and `routeData` is initially 
`undefined` on a cold load, `formDefaults` will typically be `undefined` during 
the form initialization and won’t actually seed the form defaults. If the 
intent is to ensure fetched values act as defaults for re-registered fields 
with `shouldUnregister: true`, consider switching to `useSuspenseQuery` here, 
or explicitly updating defaults via `form.reset(formDefaults)` when data 
arrives (or remounting the form via a `key` once defaults are ready).



##
src/routes/upstreams/detail.$id.tsx:
##
@@ -68,11 +71,14 @@ const UpstreamDetailForm = (
 refetch,
   } = useSuspenseQuery(getUpstreamQueryOptions(id));
 
-  const form = useForm({
-resolver: zodResolver(FormPartUpstreamSchema),
+  const formDefaults = produceToUpstreamForm(upstreamData) as 
FormPartUpstreamType;
+  const form = useForm({
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+resolver: zodResolver(FormPartUpstreamSchema) as any,
 shouldUnregister: true,

Review Comment:
   `useForm`'s `resolver` is being cast to `any` (and suppressed via eslint), 
which removes type-safety for validation and can hide real schema/form 
mismatches. Prefer fixing the resolver typing instead of casting (e.g. align 
the `useForm` generic with the schema via `z.infer`/`z.input`, or parameterize 
`zodResolver` if needed) so the form stays fully typed end-to-end.



##
src/routes/stream_routes/detail.$id.tsx:
##
@@ -61,6 +61,7 @@ const StreamRouteDetailForm = (props: Props) => {
 shouldFocusError: true,
 mode: 'all',
 disabled: readOnly,
+defaultValues: streamRouteData?.value,
   });

Review Comment:
   Similar to routes detail: because this page uses `useQuery`, 
`streamRouteData` is `undefined` on the initial render on a cold load, and 
React Hook Form won’t pick up later `defaultValues` changes. If this is meant 
to prevent values from reverting when fields are unregistered/re-registered 
(`shouldUnregister: true`), you likely need to ensure defaults are set after 
the query resolves (e.g. via suspense, a keyed remount, or resetting defaults 
when data arrives).



##
e2e/tests/upstreams.pass-host-reset.spec.ts:
##
@@ -0,0 +1,312 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { randomId } from '@e2e/utils/common';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams } from '@/apis/upstreams';
+
+test.beforeAll(async () => {
+await deleteAllUpstreams(e2eReq);
+});

Review Comment:
   This spec clears *all* upstreams in `beforeAll`. With Playwright configured 
as `fullyParallel: true` (and multiple workers locally), this can race with 
other upstream-related specs running in parallel and make the suite flaky by 
deleting resources created by other tests. Prefer cleaning up only the 
upstreams created by this spec (e.g. track created IDs and delete them in 
`afterEach`/`afterAll`), and/or wrap the file in `test.describe.configure({ 
mode: 'serial' })` if it must touch shared global state.



-- 
This is an automated message from the Apache