fix(core-state): clarify retry failure logs#2167
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds a new ChangesCore-state poll failure messaging fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
graycyrus
left a comment
There was a problem hiding this comment.
Walkthrough
Clean, well-scoped fix for the misleading 11/5 retry counters in core-state debug logs. The new coreStatePollFailureDebugMessage helper correctly distinguishes bootstrap retries from post-bootstrap background polling, and the regression test covers all boundary cases (0, within-bootstrap, at-limit, post-bootstrap). Nice explicit 11/5 negative assertion in the test too.
| File | Change | Description |
|---|---|---|
CoreStateProvider.tsx |
Enhancement | New coreStatePollFailureDebugMessage() with phase-aware log formatting; call site updated to use it |
CoreStateProvider.test.tsx |
Test | Regression test covering all debug message phases + impossible-counter negative assertion |
One minor nit below — otherwise LGTM.
| ); | ||
| expect(postBootstrapMessage).not.toContain('11/5'); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
[minor] This test is nested inside describe('coreStatePollFailureWarningMessage') but it exercises coreStatePollFailureDebugMessage. Consider adding a sibling describe('coreStatePollFailureDebugMessage') block so the test runner output groups them correctly.
Adds 10s poll backoff once the 5-retry bootstrap budget is exhausted, preventing tight retry loops during slow startup. Reverts to 2s on recovery. Builds on #2167 (debug message helper). - BACKOFF_POLL_MS = 10_000: scheduleNext uses longer delay after bootstrap exhaustion, 2s otherwise - coreStatePollFailureWarningMessage messages updated to say 'bootstrap poll failed' and 'budget exhausted; continuing with backoff' - Tests: backoff timing (fake timers), recovery revert, impossible-counter negative assertion, debug message describe block properly separated Closes #2158
Summary
11/5.Fixes #2158
Files changed
app/src/providers/CoreStateProvider.tsxapp/src/providers/__tests__/CoreStateProvider.test.tsxValidation
pnpm --dir app exec vitest run --config test/vitest.config.ts src/providers/__tests__/CoreStateProvider.test.tsx -t "describes post-bootstrap poll failures without impossible retry counters"failed before implementation withTypeError: coreStatePollFailureDebugMessage is not a function.pnpm --dir app exec vitest run --config test/vitest.config.ts src/providers/__tests__/CoreStateProvider.test.tsx -t "describes post-bootstrap poll failures without impossible retry counters"passed.pnpm --dir app exec vitest run --config test/vitest.config.ts src/providers/__tests__/CoreStateProvider.test.tsxpassed: 16 tests.pnpm --filter openhuman-app compilepassed (tsc --noEmit; local Node warnswanted >=24.0.0, currentv22.22.2).pnpm --dir app exec eslint src/providers/CoreStateProvider.tsx src/providers/__tests__/CoreStateProvider.test.tsxpassed.git diff --checkpassed.git grep -n "refresh failed attempt=%d/%d" -- app/src/providers/CoreStateProvider.tsxfound no old impossible-counter format.--no-verifyafter the focused frontend validation above passed.Blocked locally
pnpm --filter openhuman-app rust:checkfails in this environment because Tauriglib-syscannot find the system library metadata:Package 'glib-2.0', required by 'virtual:world', not found;glib-2.0.pcis missing andPKG_CONFIG_PATHis not set.pnpm --dir app run lint:commands-tokensfails becausergis not installed on this host:lint:commands-tokens requires ripgrep.Behavior / risk notes
debug('core-state')logger on poll failures.1/5through5/5, then one suppression notice.Duplicate PR check
#2158,core-state,app_state_snapshot, andpoll failed; no open PR directly fixes Core-state poll retry counter exceeds its max attempts #2158.Summary by CodeRabbit