Skip to content

[BUG] Use Raw Text and Process Again leave recording state behind when they stop a recording #1469

Backlog

Description

@dreadloop

Describe the bug

Process Again and Use Raw Text in the overlay's Actions menu stop an active recording with stopWithoutTranscription() before they run. They don't do the rest of the cleanup that discarding a recording with Escape does. I found two gaps by reading the code while working on #1466. I haven't reproduced either one at runtime.

  1. Use Raw Text keeps the recording mode. applyHistoryTextOutput doesn't call clearActiveRecordingMode() or reset the hotkey's modifier tracking, so the app still treats the discarded recording as active. The next Escape press likely goes to that stale state instead of doing its normal job. Process Again sets the mode to .dictate straight afterward, so it probably doesn't have this problem.
  2. Neither action handles a stop that's already running. Both check asr.isRunning, not isRunningOrStarting, and neither checks processingDictationLifecycleID. If a normal stop has already started, for example just after a hold-to-talk key is released, stopWithoutTranscription() returns without doing anything because the other stop holds the recording. The normal stop then delivers its transcript as well as the action's output, so text can be inserted twice. The window is a fraction of a second.

#1466 handles both cases for Insert Last. If that approach is accepted, the same handling (or a shared "discard recording" helper) could cover these two actions.

Reproduction steps

From code reading. Not confirmed at runtime.

  1. Start dictation so the overlay appears.
  2. Open the Actions menu and click Use Raw Text.
  3. Start another dictation and press Escape to cancel it.

Expected behavior

Both actions discard the active recording the same way Escape does. If a normal stop is already delivering the recording, they skip it instead of inserting twice.

Actual behavior

Expected from the code: the first Escape after Use Raw Text doesn't cancel. A history action clicked during an in-flight stop may insert twice.

App Version

1.6.13

macOS Version

27.3

Architecture

Apple Silicon

Logs or crash report

None. These come from reading the code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions