fix: catch rejected promises from async event listeners (#136)#137
Merged
fix: catch rejected promises from async event listeners (#136)#137
Conversation
- Detect thenable returns from listeners and attach .catch() to forward rejections to onError (without awaiting — emit stays synchronous) - Fix withLogPersistence() to use explicit fire-and-forget instead of async listener whose Promise was silently dropped Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Deployment failed with the following error: Learn More: https://vercel.com/mizoguchi-cojis-projects?upgradeToPro=build-rate-limit |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughウォークスルーこのPRは、イベントリスナーが返すPromiseを検出し、拒否をグローバルエラーハンドラーに転送する仕組みを追加します。ログ永続化を待たないファイアアンドフォーゲット形式に変更し、エラー正規化ユーティリティを導入し、非同期リスナーのエラー処理テストを追加します。 変更内容
推定コードレビュー労力🎯 3 (中程度) | ⏱️ ~20 分 詩
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
- Add toError(error: unknown): Error to errors.ts - Use reportError local in emit() to eliminate duplicated guard block - Replace inline ternary in job.ts with toError() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.catch()to forward rejections toonError(emit stays synchronous — no await)withLogPersistence()to use explicitvoid ...fire-and-forget instead of async listener whose Promise was silently droppedonError, emit doesn't block on async listenersCloses #136
Test plan
pnpm validate— 28/28 (301 tests)pnpm --filter @coji/durably test:node:postgres— PostgreSQL tests🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
バグ修正
パフォーマンス改善
テスト