Skip to content

Clear orphaned/unresolvable paused recording takes #170

Description

@coderabbitai

Summary

In useRecordingRecovery (src/app/screens/hooks/useRecordingRecovery.ts), when a persisted paused-take marker cannot be resolved to a verse (e.g. getVerseDetailNavByChapterAssignment returns null, or take.verseNumber is undefined), the code currently only logs a warning and leaves the marker and its segment files in storage. This marker is retried on every future app launch with no way for the user to discard it, since the recovery prompt (and its "Discard" action) never fires in this case.

Rationale

Orphaned paused takes should not accumulate indefinitely in storage. This was flagged during review of #158 but intentionally deferred, since a more holistic solution is planned: a routine cache-clear mechanism plus an explicit "clear cache" option in app settings.

Affected areas

  • src/app/screens/hooks/useRecordingRecovery.ts (promptRecovery unresolved-take branch)
  • Related: src/services/storage.ts (PausedTakeMarker, clearPausedTake, findPausedTake)
  • Related: src/services/recordingStorage.ts (deleteRecordingFile)

Acceptance criteria

  • Design and implement a routine/periodic cache-clear mechanism for orphaned paused-take markers and segment files.
  • Add an explicit "Clear cache" option in app settings that also removes orphaned paused-take data.
  • Ensure unresolvable paused takes (verse/chapter assignment no longer resolvable) are eventually cleaned up without requiring a resolvable navigation target.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions