Skip to content

fix: Voice-conditioned generation should fail clearly when selected voice audio is missing #1797

@ChuxiJ

Description

@ChuxiJ

Problem

Voice-conditioned generation can silently proceed without voice audio. If loadAudioBlobByKey returns no blob, generation continues without a user-visible warning. addVoice can also return before IndexedDB persistence finishes, creating a race window.

Root Cause

Voice profile metadata and voice audio blob persistence are not treated as an atomic precondition for voice-conditioned generation.

Solution

  • Await/confirm audio blob persistence before a voice profile is considered ready.
  • Fail voice-conditioned generation with an actionable error if selected voice audio is missing.
  • Add recovery UX to re-upload/re-record the missing voice sample.
  • Add tests for missing blob and persistence race cases.

Verification

  • Add store/service tests for addVoice persistence completion.
  • Add generation tests for missing selected voice audio.
  • Add UI test for the user-facing error and recovery path.

Files to Touch

  • src/store/voiceStore.ts
  • src/services/generationPipeline.ts
  • src/services/voiceUploadService.ts
  • src/components/voice/*

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions