mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 13:32:23 +00:00
## Summary
- Limits core-state bootstrap console warnings to the first failure plus the existing backoff suppression notice.
- Moves rewards page diagnostics from unconditional `console.debug` calls to the namespaced `debug` logger.
- Normalizes `/rewards/me` timeout/abort errors into a stable recoverable UI message.
- Adds focused coverage for rewards timeout handling and the quieter core-state warning contract.
## Problem
- #1235 reports noisy DevTools output during startup and rewards loading.
- Core-state polling already had a retry budget/backoff, but still emitted repeated bootstrap warnings.
- Rewards timeout failures surfaced raw transport messages and unconditional debug logs.
## Solution
- Keep detailed per-attempt core-state diagnostics behind the existing `debug('core-state')` logger while reducing default console warnings.
- Wrap rewards API failures with `normalizeRewardsApiError`, preserving backend errors while mapping timeout/abort failures to a retryable message.
- Keep rewards snapshot retries manual-only through the existing Try again button.
## Submission Checklist
- [x] Tests added or updated (happy path + at least one failure / edge case) per [Testing Strategy](../gitbooks/developing/testing-strategy.md#failure-path-requirement)
- [x] **Diff coverage ≥ 80%** — changed lines (Vitest + cargo-llvm-cov merged via `diff-cover`) meet the gate enforced by [`.github/workflows/coverage.yml`](../.github/workflows/coverage.yml). Run `pnpm test:coverage` and `pnpm test:rust` locally; PRs below 80% on changed lines will not merge.
- [x] Coverage matrix updated — N/A: behavior-only frontend diagnostics change, no feature row added/removed/renamed.
- [x] All affected feature IDs from the matrix are listed in the PR description under `## Related`
- [x] No new external network dependencies introduced (mock backend used per [Testing Strategy](../gitbooks/developing/testing-strategy.md#mock-policy))
- [x] Manual smoke checklist updated if this touches release-cut surfaces — N/A: no release-cut surface touched.
- [x] Linked issue closed via `Closes #NNN` in the `## Related` section
## Impact
- Desktop/web frontend console output is quieter during transient core/rewards failures.
- Users still see a recoverable rewards error state with the existing manual retry action.
- No API contract or persistence migration changes.
## Related
- Closes: #1235
- Follow-up PR(s)/TODOs: N/A
- Coverage matrix feature IDs: N/A: diagnostics-only change.
---
## AI Authored PR Metadata (required for Codex/Linear PRs)
### Linear Issue
- Key: N/A
- URL: N/A
### Commit & Branch
- Branch: codex/1235-quiet-core-rewards-timeouts
- Commit SHA: f531225b
### Validation Run
- [x] `pnpm --filter openhuman-app exec prettier --check src/providers/CoreStateProvider.tsx src/providers/__tests__/CoreStateProvider.test.tsx src/pages/Rewards.tsx src/services/api/rewardsApi.ts src/services/api/__tests__/rewardsApi.test.ts`
- [x] `pnpm --filter openhuman-app compile`
- [x] Focused tests: `pnpm --filter openhuman-app test -- src/services/api/__tests__/rewardsApi.test.ts src/providers/__tests__/CoreStateProvider.test.tsx src/pages/__tests__/Rewards.test.tsx`
- [x] `pnpm i18n:check`
- [x] `git diff --check`
- [x] Rust fmt/check (if changed): N/A, no Rust files changed.
- [x] Tauri fmt/check (if changed): N/A, no Tauri files changed.
### Validation Blocked
- `command:` N/A
- `error:` N/A
- `impact:` N/A
### Behavior Changes
- Intended behavior change: transient core-state failures no longer emit repeated default console warnings; rewards timeouts show a stable recoverable message.
- User-visible effect: quieter console and clearer Rewards retry state during backend/network slowness.
### Parity Contract
- Legacy behavior preserved: core-state still polls, backs off, and recovers; rewards still loads once and retries only on user action.
- Guard/fallback/dispatch parity checks: existing provider and rewards page tests updated.
### Duplicate / Superseded PR Handling
- Duplicate PR(s): N/A
- Canonical PR: N/A
- Resolution (closed/superseded/updated): N/A
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Bug Fixes**
* Polling warning refined to show only on the first bootstrap failure, reducing redundant alerts while preserving budget-exhaustion notices.
* **New Features**
* Rewards sync errors normalized so timeout/abort issues present a consistent retry message while preserving backend-provided error text for clarity.
* **Tests**
* Updated tests to align with the new warning and rewards-error behaviors.
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/tinyhumansai/openhuman/pull/2319?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: aqilaziz <gonzes7@gmail.com>
Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
Tauri + React + Typescript
This template should help get you started developing with Tauri, React and Typescript in Vite.