Repository navigation
fix(android): keep workspace previews open when sharing fails - #139141
Conversation
Handle export preparation and chooser failures at the Share action, keep the preview usable, and remove only the failed export attempt. Preserve prior FileProvider grants and report invalid image data instead of silently returning.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper status |
|
🦞👀
|
|
@clawsweeper re-review The initial exact-head review generation completed successfully with no findings, but the public review still has only the started/finalizing placeholder. Please complete a fresh review so the normal completed-review gate can be satisfied. Exact-head CI is green; the source and evidence are unchanged. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 5, 2026, 10:40 AM ET / 14:40 UTC. ClawSweeper reviewWhat this changesThe Android workspace browser reports sharing failures, removes the failed export attempt, and preserves the preview, with regression tests and updated documentation. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this remains a useful, focused fix absent from current main and v2026.9.1. No introduced correctness defect was found; successful-share retention remains separate work. Priority: P2 Review scores
Verification
How this fits togetherThe Android workspace browser retrieves files from the Gateway and displays previews. Sharing creates a private export copy and passes a read-only content URI to Android’s share sheet. flowchart TD
A[Gateway workspace file] --> B[Android preview]
B --> C[User taps Share]
C --> D[Prepare unique export]
D --> E[Android share sheet]
D -->|Preparation fails| F[Remove failed attempt]
E -->|Launch fails| F
F --> G[Show error and retain preview]
E -->|Launch succeeds| H[Preserve exported bytes]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +459, Docs +2, Other +3. Total +464 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep recovery in the existing Share owner; consolidated writes leave only two extra production lines for visible failure feedback and failed-attempt cleanup. Do we have a high-confidence way to reproduce the issue? Yes: obstructing the export-cache path while sharing a loaded preview reaches unguarded writes on current main. This review established the source path; installed before/after observations come from the supplied evidence. Is this the best way to solve the issue? Yes: the Share action owns both preparation and chooser errors, so one local boundary is appropriate. Reusing the bitmap/clipboard exporter or selecting a new retention lifetime would unnecessarily expand this repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bcecb3d1d19a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Handle export preparation and chooser failures at the Share action, keep the preview usable, and remove only the failed export attempt. Preserve prior FileProvider grants and report invalid image data instead of silently returning.
Related: #127434 — this fixes Android failure handling and unpublished-attempt cleanup only. Successful-share retention policy and iOS remain separate follow-ups; this does not close that issue.
The source branch is in
openclaw/openclaw, not a contributor fork.What Problem This Solves
Fixes an issue where users sharing a previewed workspace file could lose the preview or receive no useful error when Android could not prepare the export or open the share sheet.
Why This Change Was Made
The Workspace Files share action now handles preparation and chooser failures together, removes only the unpublished attempt, and reports “Could not share file.” Previously published copies remain untouched so a failed or later same-name export cannot invalidate earlier URI grants. Successful-share expiry is intentionally unchanged.
User Impact
A failed share leaves the preview available to retry or go back, with a visible error instead of an unexplained outcome. Successful text and image sharing retains its existing behavior.
Evidence
The before APK is qualified against the identical Workspace Files owner preimage for this short-file case—not as whole-APK equivalence or an exact-parent upgrade comparison.
These are inspected original frames from synthetic-only, isolated API 36 guests.
Production Kotlin is +20/-18 (net +2): one canonical exception/cleanup boundary replaces the duplicate writes and silent Base64 return. The small growth provides the missing user-visible failure outcome. Tests add 459 lines across four real-screen cases; native-source inventory adds one entry and docs add two lines. No new dependency, configuration, permission, schema, migration, retention policy, or public protocol is introduced.
All 15 local changed-file checks passed; Codex P2 review found no actionable findings. The complete current-main Workspace Files owner was byte-identical to the reviewed preimage at
9e75cf16f06b. Exact-head hosted CI33970826355 completed successfully, including both phone-flavor tests, Wear tests, APK builds, Android lint, and the required CI gate.Review disposition
The exact-head review published at 14:41 UTC reports no introduced correctness or security finding. Its remaining note is reviewer-side DNS preventing source/image downloads. The maintainer directly inspected matching AndroidX Core 1.19.0 FileProvider source and bytecode for cache-root canonicalization, URI generation and file opening, Kotlin write behavior, and the original installed captures. The distinct-UID receiver read all three exports through actual Android grants. Those observations cover the dependency and image checks; no indefinite-grant, fatal-stack, or successful-retention-policy claim is made. The repair remains at the existing Share owner, and #127434 remains separate.