fix(startup): quiet warning noise#1699
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR prevents misleading startup warnings by normalizing lifecycle hook delays to zero for invalid inputs and making EventBus renderer dispatch conditional on window presenter availability, with comprehensive tests for both normalization edge cases and optional dispatch behavior. ChangesStartup Warning Cleanup
Sequence DiagramsequenceDiagram
participant Caller
participant EventBus
participant sendToRendererIfAvailable
participant windowPresenter
participant Renderer
Caller->>EventBus: send(eventName, args)
EventBus->>sendToRendererIfAvailable: sendToRendererIfAvailable(eventName, args)
alt windowPresenter exists
sendToRendererIfAvailable->>windowPresenter: dispatchToRenderer(eventName)
windowPresenter->>Renderer: deliver event
sendToRendererIfAvailable-->>EventBus: return true
else windowPresenter unavailable
sendToRendererIfAvailable-->>EventBus: return false (silent skip)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/eventbus.ts`:
- Around line 76-82: The routing logic incorrectly lets SendTarget.DEFAULT_TAB
fall through to sendToDefaultWindow when sendToDefaultWindow exists; update the
branch so SendTarget.DEFAULT_WINDOW always calls
windowPresenter.sendToDefaultWindow(eventName, true, ...args) and
SendTarget.DEFAULT_TAB always calls windowPresenter.sendToDefaultTab(eventName,
true, ...args), using explicit checks on the SendTarget value (or separate case
blocks) and still guarding each call with typeof
windowPresenter.sendToDefaultWindow === 'function' / typeof
windowPresenter.sendToDefaultTab === 'function' as appropriate to avoid runtime
errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 10616021-4d70-4a89-8646-d487c8ede5bb
📒 Files selected for processing (9)
docs/issues/startup-warning-cleanup/plan.mddocs/issues/startup-warning-cleanup/spec.mddocs/issues/startup-warning-cleanup/tasks.mdsrc/main/eventbus.tssrc/main/presenter/configPresenter/index.tssrc/main/presenter/lifecyclePresenter/index.tssrc/main/presenter/lifecyclePresenter/lifecycleDelay.tstest/main/eventbus/eventbus.test.tstest/main/presenter/lifecyclePresenter/lifecycleDelay.test.ts
|
Addressed the CodeRabbit routing comment in 10ffb11: DEFAULT_WINDOW and DEFAULT_TAB now use separate EventBus branches, and DEFAULT_TAB is covered by a regression test that asserts sendToDefaultTab is used without calling sendToDefaultWindow. |
|
Actionable comments posted: 0 |
Summary
Tests
Summary by CodeRabbit
Bug Fixes
New Features
Tests
Documentation