Files
multica/packages
Naiyuan Qing aa27fefde1 fix(views): stale identifier-first route assertions + IssueDetail resolve loop
Four pre-existing frontend test failures, unrelated to space-context work:

- app-sidebar.test.tsx: mock of @multica/ui/components/ui/sidebar was
  missing SidebarGroupAction (added when the Spaces section landed),
  so every test in the file crashed on render.
- use-issue-actions.test.tsx / welcome-after-onboarding.test.tsx: both
  asserted the old /{ws}/issues/{id} route; the identifier-first
  /{ws}/issue/{id} route replaced it. Updated the expected paths.
- issue-detail.test.tsx: same stale-route issue on the breadcrumb link,
  plus a real bug in the IssueDetail wrapper found while fixing it —
  the wrapper resolves a non-UUID issueId to a canonical UUID via
  useQuery, and on resolve failure falls back to
  <IssueDetailInner issueId={issueId}>, which re-subscribes to the
  *same* query key. That fresh subscription's default refetchOnMount
  refetches the query, flipping the wrapper's own `isError` back to
  false mid-render, which unmounts IssueDetailInner (canonicalId still
  undefined) — which removes the subscription, which lets the retry
  settle back to isError:true, remounting IssueDetailInner — forever.
  In production this mostly self-heals fast; in tests with a
  synchronously-rejecting mock it live-locked and no test could ever
  observe a stable "not found" frame.

  Fixed by latching the wrapper's fallback decision in a ref once
  isError fires (a resolution failure shouldn't un-fail on a child's
  incidental refetch), and by giving the wrapper its own loading state
  (extracted IssueDetailSkeleton, shared with IssueDetailInner) instead
  of rendering null while resolving — real UX gap where navigating via
  a slow-to-resolve identifier showed a blank page instead of a skeleton.

packages/views test suite: 162 files / 1656 tests passing. Core/views/
web/desktop typecheck clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-08 20:46:21 +08:00
..