From 65a35e8e179f66e584673718080e46b6c32417af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B8=BA?= <1053122090@qq.com> Date: Tue, 11 Aug 2026 14:53:08 +0800 Subject: [PATCH] fix(dashboard): disable session message link prefetch Co-Authored-By: GPT-5 --- .../_components/error-details-dialog.test.tsx | 19 +++++++++++++++++-- .../components/SummaryTab.tsx | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/app/[locale]/dashboard/logs/_components/error-details-dialog.test.tsx b/src/app/[locale]/dashboard/logs/_components/error-details-dialog.test.tsx index dc6f5deff..1acb562a4 100644 --- a/src/app/[locale]/dashboard/logs/_components/error-details-dialog.test.tsx +++ b/src/app/[locale]/dashboard/logs/_components/error-details-dialog.test.tsx @@ -36,8 +36,18 @@ beforeEach(() => { }); vi.mock("@/i18n/routing", () => ({ - Link: ({ href, children }: { href: string; children: ReactNode }) => ( - {children} + Link: ({ + href, + children, + prefetch, + }: { + href: string; + children: ReactNode; + prefetch?: boolean; + }) => ( + + {children} + ), })); @@ -497,6 +507,11 @@ describe("error-details-dialog layout", () => { expect(container.querySelector('a[href*="sessionId=pfx%3Ascope%3Aroot"]')).toBeTruthy(); expect(container.querySelector('a[href*="sessionId=physical-a"]')).toBeTruthy(); expect(container.querySelector('a[href*="requestId=203"]')).toBeTruthy(); + expect( + container + .querySelector('a[href*="/dashboard/sessions/pfx%3Ascope%3Aroot/messages"]') + ?.getAttribute("data-prefetch") + ).toBe("false"); expect(container.textContent).toContain("Canonical Session ID: pfx:scope:root"); expect(container.textContent).toContain("Client Session ID: physical-a"); unmount(); diff --git a/src/app/[locale]/dashboard/logs/_components/error-details-dialog/components/SummaryTab.tsx b/src/app/[locale]/dashboard/logs/_components/error-details-dialog/components/SummaryTab.tsx index b20ea4a2f..ad967e6e1 100644 --- a/src/app/[locale]/dashboard/logs/_components/error-details-dialog/components/SummaryTab.tsx +++ b/src/app/[locale]/dashboard/logs/_components/error-details-dialog/components/SummaryTab.tsx @@ -361,7 +361,7 @@ export function SummaryTab({ {identity.value === sessionId && hasMessages && !checkingMessages && ( - +