Skip to content

Bug: Multiple Audio Permission Prompts & SmartPaste Failure #23

@jpatrickb

Description

@jpatrickb

Description

Users experience two critical issues with permissions:

Issue 1: Repeated Audio Recording Permission Prompts (3x)

When pressing the hotkey to record, users are prompted 3 times to grant audio recording access, even after:

  • Previously granting access
  • Double-checking System Settings → Privacy & Security → Microphone
  • Restarting the application

This prompt appears every single time they attempt to record, making the recording experience broken.

Issue 2: SmartPaste Always Fails

SmartPaste functionality is completely broken. Even after:

  • Granting Accessibility permission in System Settings → Privacy & Security → Accessibility
  • Enabling SmartPaste in AudioWhisper settings
  • Restarting the application
  • Manually re-adding AudioWhisper to Accessibility list

SmartPaste still silently fails to paste transcribed text into target applications.

Expected Behavior

  1. Audio permission should be requested once. After granting, it should persist and not be re-requested
  2. SmartPaste should work reliably after granting Accessibility permission

Actual Behavior

  1. User is prompted 3 times for audio access on every recording attempt
  2. SmartPaste fails silently with no indication that permissions are missing

Root Causes

Permission Prompts (Multiple Sites)

The app makes redundant permission requests from two independent code paths:

  • AudioRecorder.checkMicrophonePermission() (Sources/Services/Audio/AudioRecorder.swift:46-68)

    • Called during AudioRecorder initialization
    • Calls AVCaptureDevice.requestAccess() when status is .notDetermined
  • PermissionManager.requestMicrophonePermission() (Sources/Managers/PermissionManager.swift:132-142)

    • Called when user clicks record button
    • Calls AVCaptureDevice.requestAccess() again

This creates multiple independent system prompts instead of a single consolidated request.

SmartPaste Failure

  1. Code Signature Issue: Ad-hoc code signing changes the app's code signature hash with each build, invalidating prior Accessibility permissions per the CLAUDE.md documentation
  2. Permission Check Failure: AccessibilityPermissionManager.checkPermission() uses AXIsProcessTrustedWithOptions(nil), which fails to recognize permissions granted after the code signature changed
  3. No Runtime Refresh: The permission state appears to be checked only at startup, not dynamically

Steps to Reproduce

For Issue 1 (Permission Prompts)

  1. First time: Grant audio access when prompted
  2. Press the hotkey to record again
  3. Observe: Prompted 3 times again (even though permission was just granted)

For Issue 2 (SmartPaste)

  1. Enable SmartPaste in Settings
  2. Grant Accessibility permission in System Settings
  3. Return to AudioWhisper and attempt to record something
  4. After transcription completes, observe that text is not pasted into the target application

Suggested Solutions

Issue 1: Consolidate Permission Requests

  • Unify all microphone permission requests through PermissionManager
  • Remove independent permission requests from AudioRecorder
  • Ensure only one AVCaptureDevice.requestAccess() call occurs per permission cycle

Issue 2: Fix SmartPaste Permission Check

  • Add a runtime permission refresh mechanism to detect dynamically-granted permissions
  • Consider using AXIsProcessTrustedWithOptions([kAXTrustedCheckOptionPrompt: true]) to properly validate permissions after code signature changes
  • Implement fallback permission request if check fails
  • Add user-friendly error messages explaining the code-signing / permission requirement

General Recommendation

  • Add logging to track which permission request flows are being triggered
  • Consider adding a "Verify Permissions" button in Settings for manual refreshes
  • Display clear guidance when permissions are missing or need re-granting

Related Documentation

See CLAUDE.md section "Accessibility Permission (SmartPaste)" - describes that code signature changes with each build invalidate Accessibility permissions and require manual re-granting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions