Commit Graph
4 Commits
Author SHA1 Message Date
DongHyeonka d4aa365bd9 fix(query): stale 실패를 렌더 중에 계산하고 실패 진단이 원인을 남긴다
frontend-quality-gates / merge / static checks (pull_request) Successful in 2m26s
frontend-quality-gates / merge / tests (pull_request) Failing after 15m50s
frontend-quality-gates / merge / browser tests (pull_request) Successful in 11m10s
frontend-quality-gates / FE-GATE-017 / diagram-review (pull_request) Skipped
frontend-quality-gates / main / checker self-tests (pull_request) Skipped
frontend-quality-gates / FE-GATE-014 / config-compatibility (pull_request) Skipped
frontend-quality-gates / FE-GATE-028 / manual-accessibility-review (pull_request) Skipped
frontend-quality-gates / FE-GATE-026 / lab-performance (pull_request) Skipped
frontend-quality-gates / FE-GATE-015 / immutable-release-candidate (pull_request) Skipped
frontend-quality-gates / external-vulnerability-provider (pull_request) Skipped
frontend-quality-gates / external-provenance-provider (pull_request) Skipped
frontend-quality-gates / promote-verified-immutable-candidate (pull_request) Skipped
frontend-quality-gates / deploy-promoted-release (pull_request) Skipped
frontend-quality-gates / FE-GATE-019 / hosting-header (pull_request) Skipped
frontend-quality-gates / FE-GATE-021 / runbook-boot-config (pull_request) Skipped
frontend-quality-gates / FE-GATE-022 / runbook-chunk-mismatch (pull_request) Skipped
frontend-quality-gates / FE-GATE-023 / runbook-api-degradation (pull_request) Skipped
frontend-quality-gates / FE-GATE-024 / runbook-telemetry (pull_request) Skipped
frontend-quality-gates / FE-GATE-025 / runbook-release-rollback (pull_request) Skipped
frontend-quality-gates / FE-GATE-018 / field-web-vitals (pull_request) Skipped
useApplicationQuery가 "데이터가 있고 마지막 조회가 실패했다"는 파생 값을
effect로 state에 복사한다. 다시 시도가 그 값을 지운 뒤 refetch해도, 조회
중에 effect가 다시 돌아 true로 되돌린다. 그래서 낡은 데이터의 다시 시도가
진행 중에도 지난 실패(stale-degraded)를 보인다(1112/01-05).

query·mutation 실패 진단은 원인을 버린다. cache의 onError가 모든 실패를
cache.operation.failed로 남기는데, ApplicationQueryError에 kind가 없어
safeErrorKind가 이름(APPLICATION_QUERY_ERROR)을 쓴다. 404, 필드 거절,
abort가 한 가지로 남는다. 예상 밖 throw는 정의 이름 대신 고정 문자열
(APPLICATION_QUERY, APPLICATION_MUTATION)을 쓴다(1112/01-04).

고른 방법: staleFailure를 query.isError && hasData && !isFetching으로 렌더
중에 계산하고 state와 effect를 지운다. 다시 시도 중은 refreshing이다.
ApplicationQueryError가 failure.kind를 kind로 싣는다. 예상 밖 throw는 query
정의 ID와 mutation 정의 ID를 쓰고, 정의가 없는 legacy mutation만 옛 이름을
둔다. 버린 대안: cache onError가 ApplicationQueryError를 아예 세지 않기
(서버 실패를 cache 진단에서 잃는다).

위험·한계: 낡은 데이터의 배경 재조회 중에도 stale 대신 refreshing을
보인다. 진단 error_kind 값이 바뀌어 그 값을 읽는 대시보드가 있으면
바꿔야 한다(템플릿 안에는 없다).

검증: tests/component/application-query-bridge.test.tsx의 새 시험 셋이
고치기 전 코드에서 실패하고 고친 뒤 통과한다(desktop, PR 본문).

Refs: 1112/01-04, 1112/01-05
2026-11-13 01:50:35 +09:00
DongHyeonkaandClaude Opus 5.5 5848493580 fix(presentation): show a disabled query as idle instead of empty (R3-4)
A disabled query (no data, no error, not fetching) fell through
deriveAsyncState to "empty", so AsyncSurface rendered the
"no items" copy before the query had even started.

- AsyncState.base gains "idle" for "not started / waiting on a
  precondition". A completed empty result (`[]`, `""`, `null`) stays
  "empty"; a real first load stays "initial-loading".
- AsyncSurface renders an optional `idle` slot for idle, else nothing
  (no skeleton, no aria-busy, no empty copy, no children).

Consumer-facing: AsyncState["base"] union adds "idle" (additive);
AsyncSurface gains an optional `idle` prop. No in-repo exhaustive
switch over base needed changes.

RED (before the fix, node scripts/run-vitest.ts on the two files):
  application-query-bridge > disabled query: expected 'empty' to be 'idle'
  async-surface > derives base state 4 ({}): expected 'empty' to be 'idle'
  async-surface > idle renders neither loading nor empty:
    toBeEmptyDOMElement() received the empty-copy section
  Tests 3 failed | 25 passed (pins for first load, [] and null empty passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:14:11 +09:00
DongHyeonkaandClaude Opus 5.5 3b3765cc49 fix(presentation): stop reporting a disabled query as loading (R-8.8)
useApplicationQuery passed TanStack's isPending as isInitialLoading. A
disabled query without data is pending (fetchStatus "idle"), so dependent
queries waiting on a prerequisite showed a skeleton and aria-busy forever.

Two changes were needed:
- application-query.ts passes isPending && fetchStatus !== "idle". The
  review suggested isLoading, but with the default networkMode "online" an
  offline first load is "paused" (isFetching false), and isLoading would
  stop showing it as loading.
- deriveAsyncState fell back to "initial-loading" whenever there was no
  data, no failure and no load, so the signal fix alone still produced
  initial-loading (checked). The fallback is now "empty". This also stops a
  query that resolves to null from looking like it loads forever.

Verified: RED "does not report a disabled query without data as loading"
failed with base "initial-loading" before and passes after; "still
reports a real first load as loading, including a paused offline one"
guards the other direction. check:architecture, check:types:app,
check:types:test, lint, test:component pass; test:unit passes except the
pre-existing removal-fixture test (needs generated artifacts/ files absent
from a fresh worktree). test:reference-feature also passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 12:39:51 +09:00
donghyeon-ka 6f6c48ebb7 refactor: 도메인이 100개 1000개씩 늘어나도 유지보수 쉬운 구조로 변경 2026-09-24 00:42:21 +09:00