feat: Private Cloud Sync — list, play, share, and delete all audio files (#3215)#6191
feat: Private Cloud Sync — list, play, share, and delete all audio files (#3215)#6191eulicesl wants to merge 2 commits intoBasedHardware:mainfrom
Conversation
0df570b to
eb25d30
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end “cloud audio management” for Private Cloud Sync: backend endpoints to list and bulk-delete a user’s cloud audio, plus a mobile UI to browse conversations with cloud audio, play via streaming, share WAV exports, and delete all cloud audio with confirmation.
Changes:
- Backend: adds
GET /v1/sync/audio/conversationsandDELETE /v1/sync/audioendpoints, plus a storage helper to delete all cloud audio blobs for a user. - Mobile: adds a “Cloud Audio Files” section to the Private Cloud Sync page with play/pause, share (WAV export), and delete-all flows.
- Localization: adds new strings for the cloud-audio UI and delete-all confirmation across ARB + generated locale Dart files.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/utils/other/storage.py | Adds helper to delete all cloud audio blobs under user prefixes. |
| backend/routers/sync.py | Adds list + delete-all endpoints for cloud audio management. |
| backend/tests/unit/test_private_cloud_sync_audio_management.py | Adds unit tests covering list ordering and delete-all behavior. |
| app/lib/backend/http/api/audio.dart | Adds client API for listing cloud-audio conversations + delete-all endpoint call. |
| app/lib/services/audio_download_service.dart | Adds download/combine support for sharing cloud audio via direct URLs and safer filenames. |
| app/lib/pages/conversations/private_cloud_sync_page.dart | Implements the cloud audio management UI (list, play, share, delete-all). |
| app/lib/l10n/app_localizations.dart | Adds new localization getters and updates one doc comment. |
| app/lib/l10n/app_en.arb | Adds new English ARB keys for cloud-audio management UI. |
| app/lib/l10n/app_localizations_ar.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_bg.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_ca.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_cs.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_da.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_de.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_el.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_en.dart | Adds new cloud-audio localization strings. |
| app/lib/l10n/app_localizations_es.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_et.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_fi.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_fr.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_hi.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_hu.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_id.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_it.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_ja.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_ko.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_lt.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_lv.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_ms.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_nl.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_no.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_pl.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_pt.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_ro.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_ru.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_sk.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_sv.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_th.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_tr.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_uk.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_vi.dart | Adds new cloud-audio localization strings (currently English text). |
| app/lib/l10n/app_localizations_zh.dart | Adds new cloud-audio localization strings (currently English text). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds
Confidence Score: 4/5Safe to merge after fixing the temp-file cleanup and playback race condition in the Flutter page. Two P1 issues in the Flutter layer — a resource leak (cleanup not in finally) and a race condition in concurrent playback — should be resolved before ship. Backend and API client are solid. app/lib/pages/conversations/private_cloud_sync_page.dart — both P1 issues are here. Important Files Changed
Sequence DiagramsequenceDiagram
participant App as Flutter App
participant BE as Backend (sync.py)
participant GCS as Cloud Storage
participant FS as Firestore
Note over App,FS: List Cloud Audio
App->>BE: GET /v1/sync/audio/conversations
BE->>FS: iter_all_conversations(uid)
FS-->>BE: conversations with audio_files
BE-->>App: {conversations: [...]}
Note over App,FS: Play Audio
App->>BE: GET /v1/sync/audio/{id}/urls
BE-->>App: signed URLs (cached/pending)
App->>BE: POST /v1/sync/audio/{id}/precache (if pending)
App->>GCS: stream audio via signed URL (just_audio)
Note over App,FS: Share Audio
App->>BE: GET /v1/sync/audio/{id}/urls
BE-->>App: signed URLs
App->>GCS: download WAV files
App->>App: WavCombiner.combineWavFiles()
App->>App: SharePlus.share(XFile)
Note over App,FS: Delete All
App->>BE: DELETE /v1/sync/audio
BE->>GCS: delete blobs (chunks/, audio/, merged/)
GCS-->>BE: deleted count
BE->>FS: clear audio_files on each conversation
BE-->>App: {deleted_blobs, cleared_conversations}
Reviews (1): Last reviewed commit: "feat: add private cloud sync audio manag..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb25d30b71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the two open cloud-audio issues on the latest head:
Additional cleanup:
Validation on this updated branch:
Latest fix commit:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7cb6a002b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaf27d2e18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed all open review threads: P1 — storage.py partial-delete failure (Codex) P1 — l10n fallback gap (Codex) P2 — initState provider race (Codex) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74f3aa9f22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
f94b1e9 to
f8babb7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8babb796f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b88ac905c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2b88ac9 to
0cadc05
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0cadc057c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
0cadc05 to
b2bb61e
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42ad9175fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc20126573
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e80956f19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34addd5ff4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87b84b5193
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f53d20f to
8048800
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ba0459a to
02d08f4
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba0459a685
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Addressed the two remaining open review threads on the latest head:
Additional cleanup in touched UI file:
I'm resolving the two stale threads now because they are fixed on commit |
94bc15c to
2aea09c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2aea09cf1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const SizedBox(width: 12), | ||
| Expanded( | ||
| child: Text( | ||
| context.l10n.cloudAudioFiles, |
There was a problem hiding this comment.
Add missing l10n keys used by cloud-audio UI
PrivateCloudSyncPage now calls new localization getters such as context.l10n.cloudAudioFiles, but this commit does not add matching keys/getters in app/lib/l10n/app_localizations.dart (same issue for noCloudAudioFiles, deleteAllAudioTitle, failedToPlayCloudAudio, failedToShareCloudAudio, etc.). That leaves AppLocalizations without required members, so the app fails to compile when this page is built/analyzed. Please add the new ARB keys and regenerate localization outputs in the same change.
Useful? React with 👍 / 👎.
Summary
Risk
awaitto prevent race conditions; delete-all acquires no locks but sequences Firestore → GCS in order.Testing
pytest backend/tests/unit/test_private_cloud_sync_audio_management.py)flutter test app/test/widgets/private_cloud_sync_page_test.dart)Changes
Backend
backend/routers/sync.py— New endpoints:GET /cloud-audio(list all cloud audio with playback URLs) andDELETE /cloud-audio(bulk delete by IDs)backend/database/conversations.py— Firestore queries for cloud-audio listing, scoped to non-locked conversationsbackend/utils/other/storage.py— GCS blob deletion helpersFrontend
app/lib/pages/conversations/private_cloud_sync_page.dart— Full management UI: audio list, inline player, share action, delete with confirmationapp/lib/services/audio_download_service.dart— Handles cloud-audio download and blob URL managementapp/lib/backend/http/api/audio.dart— HTTP client for new cloud-audio endpointsTests & Dev Experience
backend/tests/unit/test_private_cloud_sync_audio_management.py— Unit tests for list and bulk-delete endpointsapp/test/widgets/private_cloud_sync_page_test.dart— Widget tests for the management UI.devcontainer/devcontainer.json— Codespaces devcontainer for easy contributor onboardingRelated