fix(gui): react-doctor shared foundations#466
Conversation
Add fetch/json helpers, client-resource hooks, and intl formatters, and keep the API auth token in memory instead of sessionStorage.
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe GUI now stores API tokens in memory, adds keyed client-resource state with polling and cancellation, provides status-aware JSON helpers, and introduces cached date and number formatting utilities. ChangesGUI client utilities
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant ReactHook
participant ClientResourceStore
participant ResourceFetcher
ReactHook->>ClientResourceStore: subscribe to keyed resource
ClientResourceStore->>ResourceFetcher: start or poll fetch with AbortSignal
ResourceFetcher-->>ClientResourceStore: resolve or reject result
ClientResourceStore-->>ReactHook: emit snapshot update
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔒 Under maintainer review — detailed feedback incoming@lidge-jun (maintainer) has this PR in an active review pass. Please do not merge, rebase, or This is a claim marker so two maintainers do not review or land the same PR at once. If you are a Baseline for this pass: No action needed from you until then. Thanks for the contribution and for your patience. Review tracker: |
|
Thank you for extracting the shared react-doctor foundations — the client-resource store is the right shape for this codebase, and the exact head verifies cleanly ( One substantive finding before merge.
Overlap with Test gap: the new resource store has no tests at all. Please add hook/store regressions for dependency changes, key changes, disabled-to-enabled transitions, polling cleanup, abort/latest-result ordering, and falsy resource values. The Reviewed as part of a maintainer review pass against |
Honor keyed deps invalidation, skip overlapping poll ticks, preserve falsy cache hits, abort in-flight fetches on imperative writes, recompute poll intervals across subscribers, evict idle stores, and tolerate empty/204 JSON bodies.
|
Addressed Codex / CodeRabbit / maintainer review on
Type-safety of the string-keyed store map left as a documented API contract (trivial / no runtime check). |
Delete leftover sessionStorage opencodex-api-token on auth install without reading it, and poll with a remaining subscriber's loader after others unmount.
Track the subscriber that started each request and invalidate it on unmount so a late resolve cannot overwrite shared snapshot data for remaining subscribers.
…main When the in-flight owner unsubscribes, start a replacement fetch from a remaining subscriber so the shared snapshot cannot stay stuck loading.
Keep poll timers stable under subscriber churn, force loading on keyed deps changes, expose undefined in fetch-json types, and tighten auth/resource tests.
Avoid attaching the memory API token or prompting on cross-origin absolute URLs that happen to use those path prefixes.
Keep cached data when React tears down and reattaches a single subscriber for pollMs or enabled changes; only delete the store on the next tick if it stays empty.
통합(dev push 완료): #437 803807a, #460 74ddd96, #431 82a47db, #405 be16c1d, #468 후속 테스트 bcaf029. close: 통합 4건 + 통합 없이 1건(#459, 설계 충돌). #457은 OPEN 유지. 이슈 close 0건 — dev에서 고쳐졌는데 안 닫힌 이슈가 없었다. 무효화: WP4(#466)와 WP6(#467)은 동료가 직접 머지했고, 우리 분석이 지적한 결함을 동료 커밋이 같은 방향으로 해소했다. 보안 보류 5건에 신규 발견 게시: #429 재분류, #355 OAuth 토큰 목적지, #424 유료 브리지 기본 ON, #408 설치 락 해제, #403 4분할 요청. A-gate는 사이클마다 3~5라운드를 돌았다. 반복된 원인은 계획서에 테스트나 코드를 적으면서 실물 소스를 확인하지 않은 것이었다.
Summary
fetch-json,client-resource, andintl-formattershelpers used by follow-up react-doctor cleanup PRs.sessionStorage) to avoid XSS-readable persistence.Stack
chore(gui): pin react-doctor to 0.9.1). This branch includes that commit until chore(gui): pin react-doctor to 0.9.1 #465 merges; please review/merge chore(gui): pin react-doctor to 0.9.1 #465 first, then rebase this if needed.Test plan
bun x tsc -bingui//api/*calls still work across reload (token must be re-entered — intentional)Summary by CodeRabbit