Skip to content

feat: include file transcriptions in backups - #1325

Draft
tarushvkodes wants to merge 1 commit into
altic-dev:mainfrom
tarushvkodes:feat/backup-file-transcriptions
Draft

tarushvkodes wants to merge 1 commit into
altic-dev:mainfrom
tarushvkodes:feat/backup-file-transcriptions

Conversation

@tarushvkodes

Copy link
Copy Markdown

Description

Settings → Backup & Restore now exports and imports File Transcription history: transcripts, speaker segments, gaps, notices and custom titles. Until now those transcripts lived only in UserDefaults and a backup left them out.

Changes

  • AppBackupDocument gains fileTranscriptionHistory: [FileTranscriptionEntry]?. It encodes with the entry's existing Codable shape, the same one the store already persists.
  • BackupService.makeBackupDocument() fills it from the new FileTranscriptionHistoryStore.makeBackupPayload(). restore(_:) applies it right after dictation history, inside the same restore lease and before settingsBackupDidRestore posts.
  • FileTranscriptionHistoryStore.restore(from:) replaces the list, sorts it newest first, keeps the store's 50-entry cap, selects the newest entry and persists.
  • The search index re-indexes an entry only when its searchRevision goes up. Restore bumps each entry past its backup revision, its currently indexed revision and the wall clock, using the same rule as dictation history. That rule moved from TranscriptionHistoryEntry.markRestored into SearchIndexRecord.revisionAfterRestore so both stores share it.

Compatibility

  • Older backups have no fileTranscriptionHistory key. They decode to nil, and restoring one leaves the current file transcripts alone, like the other fields the document added later.
  • A present but empty array clears them, because the backup recorded no file transcripts.
  • Schema version stays 1.0. The field is optional, and older app versions ignore unknown keys when they decode.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Closes #1323

Testing

New SettingsBackupRoundTripTests.testFileTranscriptionsRoundTripThroughBackupAndRestoreIntoStore uses the real types:

  • An entry with speaker segments survives BackupService.encode and then decode unchanged.
  • Removing the key gives a document whose fileTranscriptionHistory is nil.
  • FileTranscriptionHistoryStore(defaults:) on a temporary suite restores the entry. Its revision goes past a previously indexed revision, and a fresh store on the same suite reads it back.

Tests/run_settings_backup_concurrency_tests.py (the CI settings-backup check) gains stubs and assertions:

  • An export includes file transcripts.
  • Restoring a backup without the key leaves them unchanged and writes nothing.
  • Restoring a backup with the key replaces them, and an empty list clears them.

Results:

xcodebuild test -scheme Fluid -only-testing:FluidDictationIntegrationTests/SettingsBackupRoundTripTests -only-testing:FluidDictationIntegrationTests/SearchIndexTests
Test Case '-[FluidDictationIntegrationTests.SettingsBackupRoundTripTests testFileTranscriptionsRoundTripThroughBackupAndRestoreIntoStore]' passed
Executed 28 tests, with 2 tests skipped and 0 failures (0 unexpected)
** TEST SUCCEEDED **

python3 Tests/run_settings_backup_concurrency_tests.py
PASS: 168 production-method concurrency assertions

The harness run against main's BackupService.swift (--ref main) fails at the new assertion, so the assertion tests this change:

Fatal error: FAIL: export includes file transcription history
  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 27.2.1 (M5 Pro, arm64), FluidVoice main @ 3fb8b70
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml on the changed files, 0 violations
  • Ran formatter locally: SwiftFormat 0.64.6 flags these files, but only on untouched lines that main flags too. Nothing on the changed lines.
  • Ran tests locally: see above

Not done: a manual export and import in the running app, the full CI sequence (Tests/run_ci_checks.sh), and Intel.

Screenshots / Video

The test output above is the evidence. The change has no visible UI.

Notes

  • A backup now carries the full text of up to 50 file transcripts, so it can get noticeably larger. In one local install the stored file history was about 1.7 MB.

  • AI use: Claude Code drafted the change, the tests and this description.

  • A human created this PR or reviewed and approved it before submission, understands the full diff, and takes responsibility for the change.

🤖 Generated with Claude Code

Backup export now writes File Transcription history (text, speaker
segments, gaps, notices, custom titles) as an optional
fileTranscriptionHistory array, and import restores it after dictation
history inside the same restore lease. Backups without the key keep the
current file transcripts; an explicit empty array clears them.

Restored entries bump searchRevision past both the backup's and the
indexed revision so search re-indexes changed text. That rule now lives
in SearchIndexRecord.revisionAfterRestore and is shared with dictation
history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the needs screenshots Pull request needs screenshot or video evidence. label Nov 13, 2026
@github-actions

Copy link
Copy Markdown

The PR Policy check is blocking this PR because required template information is missing.

Please update the PR description with:

  • Screenshots / Video

Visual files detected:

  • Tests/FluidDictationIntegrationTests/SettingsBackupRoundTripTests.swift
  • Tests/run_settings_backup_concurrency_tests.py

Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template.

If this remains incomplete for 48 hours after opening, the PR may be closed.

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

Labels

needs screenshots Pull request needs screenshot or video evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backup export omits File Transcription history

1 participant