fix(generator): remove duplicate generate:after hook in handleEntrypoint (#1993)#2073
fix(generator): remove duplicate generate:after hook in handleEntrypoint (#1993)#2073armorbreak001 wants to merge 1 commit intoasyncapi:masterfrom
Conversation
…int (asyncapi#1993) When entrypoint is set with output='fs', the lifecycle was: 1. handleEntrypoint() → launchHook('generate:after') ← duplicate 2. executeAfterHook() → launchHook('generate:after') ← canonical This caused generate:after to fire twice, running side effects twice. Fix: Remove the hook call from handleEntrypoint(). The executeAfterHook() call in generate() is the single canonical source for this hook.
|
What reviewer looks at during PR reviewThe following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe fix removes a duplicate Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 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)
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 |
|
|
User blocked. Seems to be AI bot. |



Problem
Fixes #1993
When using Generator API with
entrypointset andoutput = 'fs'(default), thegenerate:afterhook fires twice:Root Cause
handleEntrypoint()has an internallaunchHook('generate:after')for the 'fs' output case, butgenerate()always callsexecuteAfterHook()afterward — which also launches the same hook.Impact
generate:afterside effects run twice (file cleanup, notifications, etc.)entrypoint + fsusage; other combinations are unaffectedFix
1 line removal: Delete the
launchHook('generate:after')call from insidehandleEntrypoint().The canonical hook execution is in
executeAfterHook(), called unconditionally bygenerate().Lifecycle After Fix
Summary by CodeRabbit