Repository navigation
Conversation
The Profile credits card, the Linked accounts row, and the invoices first page ran their reads with TanStack Query's default network mode, so a request that started while the app reported offline paused: it stayed pending without ever fetching. The credits slot and the linked-accounts section kept their skeleton placeholders, and the invoices list held its skeleton rows with no error or retry to leave them. Those reads now run with no network-mode gate and an explicit reconnect refetch, so each settles on content or on a retryable error and recovers when connectivity returns. The identity read settles the same way, so an unresolved getMe can no longer keep the credits read disabled. A read that fails while the device is confirmed offline now presents the offline error variant.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe follow-up commit restores the offline cold-start fast path for the app-wide identity read while keeping the settling behavior, and its test/mocking updates are consistent; no new issues found in the incremental diff. Overview
Verification
Files Reviewed (4 files)
Note: verification was limited to static review; no test suite was executed in this read-only session. Previous Review Summary (commit 1ca48b7)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 1ca48b7)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe TanStack Overview
Issue Details (click to expand)WARNING
Files Reviewed (14 files)
Reviewed by deepseek-v4.1-flash-1017 · Input: 83.8K · Output: 14.7K · Cached: 1.8M Review guidance: REVIEW.md from base branch |
|
bot: Verified on the Android emulator against the local dev stack (local fake account, personal and seeded organization contexts). Each capture was read back and matches the state named in its alt text.
Limitation: this environment has no Stripe-backed organization invoices, so the invoices screen settles to its retryable error rather than rows or the empty state. Those branches are covered by the mounted suite. |
The identity read now starts regardless of the online manager, so it is no longer paused while the app reports offline. That removed the immediate signal the root layout used to open on the restored account on a cold start: the bootstrap would wait for the attempt to fail instead, up to the control-plane deadline on a hanging connection. The hook subscribes to the online manager and reports the identity as unreachable as soon as the manager reports offline, so an offline launch still resolves the restored account at once while the attempt settles on its own. Also annotate the invoices observer in its test so the assertion follows the router's page types instead of a fixed one.
|
bot: Re-ran the device check on head
Limitation: the local environment has no Stripe-backed invoices, so the invoices read answers with a server error rather than rows or the empty state; those branches stay covered by the mounted suite. |














What
The Profile tab's credits balance and Linked accounts reads, and the organization invoices first page, ran with TanStack Query's default network mode. A request that started while the app reported offline stayed
paused: pending without ever fetching. The credits slot and the Linked accounts section then had no state to leave, and the invoices screen kept its skeleton rows with no error or retry to escape them.apps/mobile/src/components/profile-credits-card.tsx: the balance and credit-block reads run withnetworkMode: 'always'and an explicitrefetchOnReconnect: true.@tanstack/query-corederivesrefetchOnReconnect = networkMode !== 'always'when it is undefined, so the reconnect refetch has to be asked for.apps/mobile/src/lib/hooks/use-current-user-id.ts: the identity read settles the same way, so an unresolvedgetMecan no longer leave the credits read disabled behind it. Thepausedbranch inisUnreachableis now unreachable and removed.apps/mobile/src/components/profile-screen.tsx: the providers read settles the same way, and both failure surfaces on the screen present theofflineerror variant when the connectivity probe has committed offline. The choice is reactive, so a connectivity commit re-renders it.apps/mobile/src/lib/hooks/use-organization-queries.ts:buildOrgInvoicesPageQueryOptionssettles its first page the same way.apps/mobile/src/lib/organization-invoice-error-variant.ts: the invoices error-variant rule moved into a pure selector, unit-tested, so the screen stays inside its line budget. A permanent code wins over connectivity; a confirmed-offline failure presents connectivity;unknownkeeps the neutral retryable copy.Two consequences worth stating. A read now interrupts the wait: a refused connection fails in about a second instead of waiting for the app to be told it is online again, and a hanging one is bounded by the existing tRPC control-plane deadline (15 s) plus the app's default retry budget (1 s + 2 s), so the worst case to a visible error is about 48 s, as on every other screen. The reconnect refetch means recovery no longer needs a manual Retry.
Verification
Local stack on this VM (Postgres, Next.js, Metro), Android emulator, local fake account with a personal context and one seeded organization. No production data or endpoints involved.
Mounted tests against a real query client with the online manager committed offline. Each behavior test fails without the change:
profile-credits-card.mounted.test.tsx: the balance renders while the app reports offline, and an unreachable balance settles to the failure copy with no skeleton.profile-screen.queries.mounted.test.tsx: the linked account renders while offline; an unreachable read settles toCould not load accountswith Retry; a confirmed-offline failure presents the offline variant.use-organization-queries.test.ts: the invoices options settle to an error while offline and refetch once connectivity returns.organization-invoice-error-variant.test.ts: the variant precedence.pnpm --filter kilo-app test— 1195 files, 17907 tests passed.On the emulator, observed states:
$0.00with Add credits, and the Linked accounts row with the account address.Limitation: this environment has no Stripe-backed organization invoices, so the invoices screen settles to its retryable error rather than rows or the empty state. The rows and empty branches are covered by the existing mounted suite.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Settle getMe app-wide
Answer: Pick the offline variant reactively
Answer: Keep the app's default retry