fix: fire afterListeningStopped hook on auto-stop#4448
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
fix: fire afterListeningStopped hook on auto-stop#4448devin-ai-integration[bot] wants to merge 1 commit intomainfrom
afterListeningStopped hook on auto-stop#4448devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
… event) Move the afterListeningStopped hook dispatch from the manual stop() action into the handleLifecycleEvent 'inactive' handler. This ensures the hook fires regardless of whether the session ended via manual stop or auto-stop (e.g. meeting app closes, audio device disconnects). By consolidating the hook dispatch to a single location, double-firing is eliminated by design — the hook always fires exactly once when the session transitions to inactive from an active or finalizing state. Co-Authored-By: John <john@hyprnote.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote canceled.
|
✅ Deploy Preview for hyprnote-storybook canceled.
|
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
Moves the
afterListeningStoppedhook dispatch from the manualstop()action into thehandleLifecycleEventhandler for"inactive"transitions. This ensures the hook fires for both manual stops and auto-stops (e.g., meeting app closes, audio device disconnects).Previously, the hook was only called inside
stop()'sonSuccesshandler, meaning auto-stop paths that go directly through the lifecycle event system never triggered it. By consolidating to a single dispatch site in the"inactive"handler, double-firing is eliminated by design.What changed:
handleLifecycleEvent("inactive"): CapturessessionIdandstatusbefore state is cleared, then dispatchesafterListeningStoppedif transitioning from"active"or"finalizing"with a valid session.stop(): Stripped of hook dispatch logic — now only callsstopSessionEffect()and handles failure. The lifecycle event handler takes care of the hook.Review & Testing Checklist for Human
stop()always produces an"inactive"lifecycle event. This is the critical assumption: since the hook was moved out ofstop()'s success handler and into the lifecycle handler, ifstopSessionEffect()succeeds without emitting an"inactive"event, the hook would silently not fire for manual stops. Trace through the Rust backend (tauri-plugin-listener) to confirm.afterListeningStoppedfires with correctsessionId/resource_dir.afterListeningStoppedfires.Notes
packages/tiptap/src/prompt/jinja.ts(codemirror version mismatch) is unrelated to this change.app_meetingis passed asnullin the hook args, consistent with the originalstop()behavior.Link to Devin session: https://app.devin.ai/sessions/d7e04927d2ae4639a200a9431e50da35
Requested by: @ComputelessComputer