Repository navigation
fix(export): restore mobile data sharing and add macOS export - #20173
Conversation
Failure-Class: none Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fec04a2589
ℹ️ 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.
All reported issues were addressed across 125 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Fail closed on unreadable encrypted fields, stop reads on disconnect, and retain completed downloads for owner-bound share retries and stale cleanup. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Ignore stale UI callbacks and prove an active share cannot trigger cleanup. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
# Conflicts: # app/lib/l10n/app_ar.arb # app/lib/l10n/app_be.arb # app/lib/l10n/app_bg.arb # app/lib/l10n/app_bn.arb # app/lib/l10n/app_bs.arb # app/lib/l10n/app_ca.arb # app/lib/l10n/app_cs.arb # app/lib/l10n/app_da.arb # app/lib/l10n/app_de.arb # app/lib/l10n/app_el.arb # app/lib/l10n/app_en.arb # app/lib/l10n/app_es.arb # app/lib/l10n/app_et.arb # app/lib/l10n/app_fa.arb # app/lib/l10n/app_fi.arb # app/lib/l10n/app_fr.arb # app/lib/l10n/app_he.arb # app/lib/l10n/app_hi.arb # app/lib/l10n/app_hr.arb # app/lib/l10n/app_hu.arb # app/lib/l10n/app_id.arb # app/lib/l10n/app_it.arb # app/lib/l10n/app_ja.arb # app/lib/l10n/app_kn.arb # app/lib/l10n/app_ko.arb # app/lib/l10n/app_localizations.dart # app/lib/l10n/app_localizations_ar.dart # app/lib/l10n/app_localizations_be.dart # app/lib/l10n/app_localizations_bg.dart # app/lib/l10n/app_localizations_bn.dart # app/lib/l10n/app_localizations_bs.dart # app/lib/l10n/app_localizations_ca.dart # app/lib/l10n/app_localizations_cs.dart # app/lib/l10n/app_localizations_da.dart # app/lib/l10n/app_localizations_de.dart # app/lib/l10n/app_localizations_el.dart # app/lib/l10n/app_localizations_en.dart # app/lib/l10n/app_localizations_es.dart # app/lib/l10n/app_localizations_et.dart # app/lib/l10n/app_localizations_fa.dart # app/lib/l10n/app_localizations_fi.dart # app/lib/l10n/app_localizations_fr.dart # app/lib/l10n/app_localizations_he.dart # app/lib/l10n/app_localizations_hi.dart # app/lib/l10n/app_localizations_hr.dart # app/lib/l10n/app_localizations_hu.dart # app/lib/l10n/app_localizations_id.dart # app/lib/l10n/app_localizations_it.dart # app/lib/l10n/app_localizations_ja.dart # app/lib/l10n/app_localizations_kn.dart # app/lib/l10n/app_localizations_ko.dart # app/lib/l10n/app_localizations_lt.dart # app/lib/l10n/app_localizations_lv.dart # app/lib/l10n/app_localizations_mk.dart # app/lib/l10n/app_localizations_mr.dart # app/lib/l10n/app_localizations_ms.dart # app/lib/l10n/app_localizations_nl.dart # app/lib/l10n/app_localizations_no.dart # app/lib/l10n/app_localizations_pl.dart # app/lib/l10n/app_localizations_pt.dart # app/lib/l10n/app_localizations_ro.dart # app/lib/l10n/app_localizations_ru.dart # app/lib/l10n/app_localizations_sk.dart # app/lib/l10n/app_localizations_sl.dart # app/lib/l10n/app_localizations_sr.dart # app/lib/l10n/app_localizations_sv.dart # app/lib/l10n/app_localizations_ta.dart # app/lib/l10n/app_localizations_te.dart # app/lib/l10n/app_localizations_th.dart # app/lib/l10n/app_localizations_tl.dart # app/lib/l10n/app_localizations_tr.dart # app/lib/l10n/app_localizations_uk.dart # app/lib/l10n/app_localizations_ur.dart # app/lib/l10n/app_localizations_vi.dart # app/lib/l10n/app_localizations_zh.dart # app/lib/l10n/app_lt.arb # app/lib/l10n/app_lv.arb # app/lib/l10n/app_mk.arb # app/lib/l10n/app_mr.arb # app/lib/l10n/app_ms.arb # app/lib/l10n/app_nl.arb # app/lib/l10n/app_no.arb # app/lib/l10n/app_pl.arb # app/lib/l10n/app_pt.arb # app/lib/l10n/app_ro.arb # app/lib/l10n/app_ru.arb # app/lib/l10n/app_sk.arb # app/lib/l10n/app_sl.arb # app/lib/l10n/app_sr.arb # app/lib/l10n/app_sv.arb # app/lib/l10n/app_ta.arb # app/lib/l10n/app_te.arb # app/lib/l10n/app_th.arb # app/lib/l10n/app_tl.arb # app/lib/l10n/app_tr.arb # app/lib/l10n/app_uk.arb # app/lib/l10n/app_ur.arb # app/lib/l10n/app_vi.arb # app/lib/l10n/app_zh.arb
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b6689afcb
ℹ️ 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".
Backend: register the export iterators in the Firestore query-driver registry under their module path, resolve the Firestore client at call time with a keyword-only seam, and expose the real portability_read module to the two test files that stub utils.other. Mobile: delete the export directory when the share sheet is dismissed, stop protecting a retained export that belongs to a signed-out or switched account, and assert that no .part files survive a failure. macOS: invalidate the captured session after a second export 401, record the auth-retry outcome, unregister the automation action when Settings disappears, and move the view's coverage to a flow step that drives the visible export row. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9d80cb4b4
ℹ️ 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".
…tract test Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…token refresh The retry share now keeps the export directory only after a successful share. A snapshot-bound request falls back to the session's still-valid stored token when the forced refresh fails transiently; expired tokens and stale snapshots still fail closed. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
GET /v1/users/export?stream=truecompletion protocol. No timeout, auth policy, deployment control, or completeness requirement is weakened.Production evidence and request limits
User-supplied production evidence: a real
GET /v1/users/exportfor an approximately 4,300-conversation account returned HTTP 504 after 30.4 seconds with zero response bytes. This is supplied evidence, not a production request made or independently reproduced in this task. No production account data orapi.omi.merequest was accessed.The eager route constructs and validates the whole export before committing headers. Streaming sends the opening JSON chunk before user-data reads, avoiding that eager first-byte mechanism. This does not establish which production layer generated the supplied 504, nor promise that every large export finishes.
Repository timeout trace:
backend/main.py:309-332wiresHTTP_GET_TIMEOUTintoTimeoutMiddleware;backend/utils/other/list_budget.py:3-6documents the production GET budget as 30 seconds.backend/utils/other/timeout.py:20,84-95has an unset-variable fallback of 120 seconds, and itswait_for(call_next(...))bounds response setup, not the entire streamed body..github/actions/deploy-backend-stack/action.yml:607-626, with flags rendered frombackend/deploy/runtime_env.yaml:2606-2615andbackend/scripts/render_backend_runtime_env.py:140-165. Neither pins--timeout/timeoutSecondsorHTTP_GET_TIMEOUT. The Cloud Run request timeout is therefore inherited from the service, not ascertainable from the checked-in deploy configuration. No live infrastructure read was performed. Do not substitute Cloud Run's creation default for a verified deployed value.macOS uses the main Python data API (
APIClient.baseURL), not the Rust data plane. The separatedesktop-backendservice does not registerrouters.users; backend deployment is required separately from client releases.Review findings addressed
backend/database/conversations.py:131,467,493;backend/database/chat.py:89;backend/database/memories.py:175;backend/tests/services/users/test_data_export_strict_reads.py:234,331.backend/services/users/data_export.py:346-457;app/test/widgets/data_export_test.dart:540;desktop/macos/Desktop/Tests/AccountDataExportTests.swift:442.app/lib/services/auth_service.dart:185-201;app/lib/backend/http/shared.dart:62,242,377;app/lib/backend/http/user_data_export.dart:22;app/test/unit/auth_session_snapshot_test.dart:35,66,124,190.app/lib/pages/settings/data_export.dart:231-302,314-427;app/test/widgets/data_export_test.dart:425,470,570,625,670.backend/services/users/data_export_response.py:60-116;backend/tests/routers/test_users_export_streaming.py:188-461.app/lib/pages/settings/data_export_files.dart:20-56;app/test/unit/data_export_files_test.dart:29-159;app/test/widgets/data_export_test.dart:697.The fix uses reusable read-context, response-lifecycle, session-snapshot, and file-lifecycle primitives rather than adding source-string guards.
Test plan
All checks use local synthetic fixtures only; logs are retained under
/tmp/omi-lane-data-export-logs/.backend/.venvcreated from the pinned macOS lock, Python 3.11.15.PYTHON=.venv/bin/python bash test-preflight.sh: 18 checks passed, no failures; optional integration-service warnings.BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh: 177 passed across the four original export route/service suites, real encrypted strict-read fixtures, cursor pagination, and memory visibility. Log:backend-test-sh-round2b.log.flutter pub get; focusedflutter testexport widget/downloader, file cleanup, auth-session snapshot, and existing auth-refresh suites: 68 passed. Touched-source analyzer: no issues. Log:flutter-round2-rework.log(final result; earlier full output influtter-targeted.log).xcrun swift build -c debug --build-tests --package-path Desktop;xcrun swift test --skip-build --package-path Desktop --filter 'AccountDataExport|UserDataExport': 19 passed. Includes real APIClient truncated-200 → model error → successful Retry. Logs:swift-build.log,swift-test.log.final-flutter-widgets.log.make mobile-verify ARGS="fast --paths ...": 23/23 hermetic journeys passed, loopback only. Log:final-mobile-verify.log.PYRIGHT_PYTHON=.venv/bin/python bash scripts/typecheck.sh: 0 errors, 9,157 warnings (not a warning-free claim). Log:final-typecheck.log.--checksurfaces are up to date; Dart--all --check, TypeScript--check, Swift--check, and released app-client compatibility passed. No API/schema change in round 2; checks found no regeneration necessary. Logs:final-openapi-*.log,final-gen-*.log,final-app-client-compat.log.OMI_PR_BODY_FILE=/tmp/omi-export-pr-body-round2.md git push origin HEAD:refs/heads/lane/data-export-fixpassed the intact bounded pre-push hook: 58 selected manifest check slots passed, generators and Swift compile passed, and the bounded backend test selection passed. The history-dependent failure-class guard reported SKIP on shallow history, not a verified history verdict. No skip flag, force-push, or policy change was used. Hook evidence: worktree Git metadataomi-preflight/pre-push/preflight.log.git ls-remote: remoterefs/heads/lane/data-export-fixand local HEAD both equalf455f4dc4a857d299b4cccf5dcf3a9993a91e33e; GitHub PR head matches. Working tree clean; PR remains OPEN and was not merged.OMI_PR_BODY_FILE=/tmp/omi-export-pr-body-round2.md make preflightran and failed at the line-count check's synthetic merge into currentorigin/main: 99 localization conflicts (49 ARBs and 50 generated Dart files). The successful normal push hook uses the merge-base and does not establish current-main mergeability. Missing INV-MEM-1/INV-MEM-4 metadata citations were added and passed in the push hook. Logs:final-make-preflight-2.log,final-pr-preflight-metadata.log. GitHub currently reports the PR as DIRTY.origin/mainafter it lands, resolve localization conflicts preserving both sides, and reverify. Its fixes have not been copied into this PR.Known limits
share_plus11 stages the file in its FileProvider cache on the platform thread. This PR retains a completed export after sharing fails so Try Again only retries sharing; it does not add a custom FileProvider/native share implementation. Very large shares can still block or require additional disk space. A no-copy FileProvider path needs a separate native implementation and device validation.Real-device verification limits
Physical iPhone/iPad/Android share/save sheets, large-file Android platform-thread latency/copying, native macOS NSSavePanel, foreground/background transitions, app restart with a real receiving app, and production Cloud Run/load-balancer streaming are NOT VERIFIED. Hermetic tests exercise production APIs with synthetic transport/auth/filesystem fixtures; compilation is not a claim of device behavior. No native install or production-account test is performed in this task.
Product invariants affected
Failure-Class: none
Line-Count-Exception: backend/database/chat.py | 1499 -> 1507 | Keep the existing owner-scoped message reader and bulk export iterator as the decryption/cancellation boundary; the reusable strict-read primitive lives outside this file
Line-Count-Exception: backend/database/conversations.py | 3458 -> 3483 | Wire export-only verified transcript/photo/manual-speaker reads and cooperative bulk cancellation into the existing owner-scoped read helpers without duplicating decryption logic
Line-Count-Exception: backend/database/memories.py | 1605 -> 1610 | Add export-only fail-closed content/evidence verification to the existing historical memory decryptor while preserving normal display tolerance
Line-Count-Exception: backend/routers/users.py | 2521 -> 2547 | Preserve the established released-client export route and OpenAPI identity; additive streaming/completion wiring stays here while disconnect lifecycle and serialization live in feature modules
Line-Count-Exception: backend/utils/memory/memory_service.py | 4342 -> 4374 | Preserve canonical privacy and suppression authority while adding cooperative export scan checks and deterministic closure of the owned canonical/historical iterators
Generated with Devin