Skip to content

Revoke previous recording preview URL before starting a new take #13

Description

@AlexMnrs

Problem

PromptFlow creates an object URL for each recorded take so the user can review, download, or share it in the browser. The current URL is revoked when a recording finishes and replaces an existing review URL, and also when the user dismisses the take.

There is one gap: starting a new recording clears recordedUrl with setRecordedUrl('') before the next recorder.onstop callback gets a chance to revoke the previous URL. That can leave the old blob: URL alive until the page reloads.

Relevant code: src/App.tsx, around the beginRecording, dismissRecording, and recording review state.

Proposed fix

Revoke the existing recorded take URL before clearing it when a new recording starts. Keep the existing dismiss behavior intact.

Acceptance criteria

  • Starting a new recording revokes any previous recorded take object URL.
  • Dismissing a take still revokes the current object URL.
  • Repeated record/review/record cycles do not leave stale object URLs behind.
  • Download and share behavior for the latest take still works.

Verification

  • Run npm run lint.
  • Run npm test.
  • Run npm run build.
  • If possible, manually record two short takes in a row and confirm the latest take can still be reviewed/downloaded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions