Skip to content

fix(ios): block omitted share attachments#104842

Closed
jincheng-xydt wants to merge 4 commits into
openclaw:mainfrom
jincheng-xydt:fix/103363-ios-share-omission-proof
Closed

fix(ios): block omitted share attachments#104842
jincheng-xydt wants to merge 4 commits into
openclaw:mainfrom
jincheng-xydt:fix/103363-ios-share-omission-proof

Conversation

@jincheng-xydt

@jincheng-xydt jincheng-xydt commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #103363.

The iOS Share Extension accepted at most three image attachments and ignored videos, files, PDFs, and unknown attachment providers while still moving toward the normal send flow. That let a user share partial content without any visible explanation.

Why This Change Was Made

This keeps the current gateway media contract unchanged: the share route still sends image attachments only, and it does not attempt to add video/PDF/file transport in this PR.

Instead, extraction now records selected image count, accepted image count, and unsupported attachment classes. If the extension would omit selected content, the compose card enters the existing blocked state with a concrete recovery message, so send stays disabled until the user removes omitted items and shares again.

User Impact

  • Sharing 6 images now shows: Only 3 of 6 images can be sent. Remove omitted items and share again.
  • Sharing a video, PDF/file, or unknown attachment now shows an unsupported-item message instead of silently sending only text or the first accepted images.
  • Normal shares with up to 3 images are unchanged.

Evidence

Focused local proof:

SHARE_ATTACHMENT_SUMMARY_PROOF=PASS
Only 3 of 6 images can be sent. Remove omitted items and share again.
OpenClaw Share cannot send 1 video(s), 2 file(s), 1 unsupported item(s) yet. Remove omitted items and share again.

Validation run:

swiftc /tmp/.../ShareAttachmentSummary.swift /tmp/.../main.swift -o /tmp/.../share-proof && /tmp/.../share-proof
git diff HEAD^ HEAD --check

Real proof

Exact-head native simulator proof for 5dda9040ac66350805428609bca660dd5373e6f6.

Environment: iPhone 17 Pro simulator, iOS 26.2 (23C54), Xcode 27.0. The installed app's OpenClawGitCommit is the exact PR head above. Both scenarios used the real Photos → Share Sheet → OpenClaw Share Extension path.

Six-image omission path

  • Selected 6 photos in Photos.
  • The extension rendered: Only 3 of 6 images can be sent. Remove omitted items and share again.
  • Send was disabled.
  • After entering Compare all six images, Send remained disabled.
  • XCTest result: Passed (39.91s).

Six selected images show the omission warning with Send disabled

Normal one-image control

  • Selected 1 photo in Photos.
  • After entering Describe this image, Send enabled normally.
  • XCTest result: Passed (27.65s).

A normal one-image share enables Send after draft text is entered

Focused commands:

xcodebuild ... -only-testing:OpenClawUITests/ShareExtensionUITests/testSixSelectedImagesShowOmissionWarningAndKeepSendDisabled test
xcodebuild ... -only-testing:OpenClawUITests/ShareExtensionUITests/testOneSelectedImageStillEnablesSendAfterDraftText test

The UI-test additions were a local proof harness only; no test or product files were pushed to the contributor branch.

Source proof comment: #104842 (comment)

@jincheng-xydt
jincheng-xydt force-pushed the fix/103363-ios-share-omission-proof branch from cb3057a to 63af225 Compare July 12, 2026 00:58
@jincheng-xydt

Copy link
Copy Markdown
Contributor Author

Exact-head proof for 63af2257534003799f7275ae8a711086f70c4926:

SHARE_ATTACHMENT_SUMMARY_PROOF=PASS
Only 3 of 6 images can be sent. Remove omitted items and share again.
OpenClaw Share cannot send 1 video(s), 2 file(s), 1 unsupported item(s) yet. Remove omitted items and share again.

Validation run on this head:

swiftc /tmp/.../ShareAttachmentSummary.swift /tmp/.../main.swift -o /tmp/.../share-proof && /tmp/.../share-proof
git diff HEAD^ HEAD --check

What this proves:

  • A share with all selected images accepted has no omission warning.
  • A share with 6 selected images and the current 3-image accepted limit surfaces an explicit blocked message before send.
  • A share containing unsupported videos/files/unknown attachments surfaces an explicit blocked message before send.
  • The current gateway media contract is unchanged; this PR prevents silent partial delivery instead of attempting new video/PDF/file transport.

Host limitation for simulator proof: this macOS 12 host only has Apple Command Line Tools. xcodebuild requires full Xcode, simctl is unavailable, and Homebrew cannot install current xcodegen here because it requires Xcode 15.3. I did not fabricate UI screenshots from this environment.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 6:53 AM ET / 10:53 UTC.

Summary
Blocks iOS Share Extension sends when selected attachments would be omitted, adds localized omission summaries and logic tests, and also relaxes two unrelated macOS test waits.

PR surface: Other +162. Total +162 across 6 files.

Reproducibility: yes. at source level: current main deterministically caps accepted images at three and discards the attachment-class counters. A before-fix native run on current main was not supplied, so this is source-reproducible rather than a fully executed current-main reproduction.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #103363
Summary: This PR is the candidate fix for the linked canonical issue describing the same silent image truncation and unsupported attachment loss.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rebase or otherwise resolve the dirty merge state and remove the unrelated macOS timeout change unless a maintainer explicitly owns it.
  • [P1] Add redacted exact-head simulator screenshots, recording, or XCTest output for excess images and an unsupported video or file share.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Native screenshots and XCTest results convincingly show the old 5dda904 six-image and control flows, but the current 94b0be6 head and unsupported video/file path need redacted real proof; update the PR body afterward to trigger review, or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] The change intentionally replaces partial delivery with fail-closed behavior, so shares that previously sent text or a subset of images will now stop until unsupported or excess items are removed.
  • [P1] The native screenshots prove only an older head's six-image and one-image flows; current-head behavior and the video/file rejection path remain unproven in a real share sheet.
  • [P1] The dirty merge state prevents confident review of the final merged result until the branch is rebased or conflicts are resolved.
  • [P2] The unrelated macOS timeout relaxation broadens the landing scope and could mask slow restart behavior without contributing to the iOS fix.

Maintainer options:

  1. Prepare a clean exact-head iOS fix (recommended)
    Rebase, split the macOS timeout change, and add native current-head proof for excess images plus an unsupported video or file before merge.
  2. Explicitly accept fail-closed upgrade behavior
    Maintain the combined scope only with maintainer ownership of the new blocked-send behavior, resolved conflicts, and complete exact-head proof.
  3. Pause until native proof is available
    Leave the PR open rather than merging an unproven head if the unsupported attachment path cannot currently be exercised in a real share extension.

Next step before merge

  • [P1] A maintainer should resolve the dirty branch and scope choice, then require current-head native proof; there is no discrete code defect suitable for automated repair.

Maintainer decision needed

  • Question: Should the unrelated macOS timeout relaxation remain in this iOS delivery fix, or should the PR be reduced to the clean iOS-only change before final proof and merge?
  • Rationale: The timeout change is independently meaningful test behavior, while the iOS fix already has a coherent narrow boundary; choosing whether to combine them is a maintainer scope and merge-risk decision.
  • Likely owner: steipete — They authored the current enforcement and timeout commits and are best positioned to decide the intended landing scope.
  • Options:
    • Split and rebase the iOS fix (recommended): Remove the macOS timeout change, resolve the dirty base, and collect exact-head native proof for both excess-image and unsupported-attachment blocking.
    • Keep the combined branch: Explicitly accept the macOS timeout change as part of this landing, resolve conflicts, and provide proof and review covering both surfaces.

Security
Cleared: The Swift product, test, project, and i18n changes introduce no concrete credential, authorization, dependency, downloaded-code, workflow-permission, or supply-chain concern.

Review details

Best possible solution:

Land a clean iOS-only branch that preserves controller-level fail-closed enforcement, rebases onto current main, and includes redacted exact-head simulator proof for normal images, excess images, and at least one unsupported video or file share.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main deterministically caps accepted images at three and discards the attachment-class counters. A before-fix native run on current main was not supplied, so this is source-reproducible rather than a fully executed current-main reproduction.

Is this the best way to solve the issue?

Yes in direction: blocking the send at the controller boundary is safer and narrower than silently delivering partial content or expanding the gateway media contract. The final solution should exclude unrelated macOS test behavior and be proven on the exact mergeable head.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 801252c66e77.

Label changes

Label justifications:

  • P1: The PR addresses deterministic silent omission of user-selected attachments in an active iOS message-delivery workflow.
  • merge-risk: 🚨 compatibility: Existing shares that previously delivered partial content will instead fail closed and require the user to remove selected items.
  • merge-risk: 🚨 message-delivery: Incorrect block-reason classification or send-state enforcement could either suppress valid shares or allow partial attachment delivery.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Native screenshots and XCTest results convincingly show the old 5dda904 six-image and control flows, but the current 94b0be6 head and unsupported video/file path need redacted real proof; update the PR body afterward to trigger review, or ask a maintainer to comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Native screenshots and XCTest results convincingly show the old 5dda904 six-image and control flows, but the current 94b0be6 head and unsupported video/file path need redacted real proof; update the PR body afterward to trigger review, or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Other +162. Total +162 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 6 173 11 +162
Total 6 173 11 +162

What I checked:

Likely related people:

  • steipete: Authored the enforcement, i18n synchronization, and macOS timeout commits on the current head and repeatedly refreshed the branch, making them the clearest owner for final scope and merge-risk decisions. (role: current branch steward and recent adjacent contributor; confidence: high; commits: b63179f5e21c, 0f22995a52fa, 94b0be6249db; files: apps/ios/ShareExtension/ShareViewController.swift, apps/ios/ShareExtension/ShareAttachmentSummary.swift, apps/.i18n/native-source.json)
  • Mariano Belinky: The repository contribution guide identifies Mariano Belinky with the iOS app area, making them a likely reviewer for share-extension behavior despite the available context not exposing a specific matching commit. (role: iOS area owner; confidence: medium; files: apps/ios/ShareExtension/ShareViewController.swift, apps/ios/ShareExtension/ShareAttachmentSummary.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-13T02:04:41.222Z sha 5dda904 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-13T03:24:13.112Z sha 9856240 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T04:34:54.451Z sha 6aa48c6 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T05:59:15.341Z sha 926d372 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T08:12:47.372Z sha 75f1114 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T08:33:56.582Z sha 4e62079 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T09:23:26.683Z sha 58de196 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T09:39:01.711Z sha 58de196 :: needs real behavior proof before merge. :: none

@jincheng-xydt
jincheng-xydt force-pushed the fix/103363-ios-share-omission-proof branch from 63af225 to ee6c879 Compare July 12, 2026 01:55
@jincheng-xydt

Copy link
Copy Markdown
Contributor Author

Updated exact-head proof for ee6c879333f1164ef3ca56bc113b8bdd1c53671f after SwiftFormat repair:

SHARE_ATTACHMENT_SUMMARY_PROOF=PASS

Validation run on this head:

swiftc /tmp/.../ShareAttachmentSummary.swift /tmp/.../main.swift -o /tmp/.../share-proof && /tmp/.../share-proof
git diff --check

CI failure follow-up from the previous head:

  • ios-build failed in SwiftFormat on the && condition chain in ShareViewController.swift.
  • Scan iOS dead code failed because Periphery's xcodebuild step hit that same SwiftFormat failure before producing findings.
  • Current head replaces that condition chain with Swift comma conditions.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@jincheng-xydt
jincheng-xydt force-pushed the fix/103363-ios-share-omission-proof branch from ee6c879 to 5dda904 Compare July 12, 2026 02:38
@jincheng-xydt

Copy link
Copy Markdown
Contributor Author

Updated exact-head proof for 5dda9040ac66350805428609bca660dd5373e6f6:

SHARE_ATTACHMENT_SUMMARY_PROOF=PASS
IMAGE_PROCESSING_PRECEDENCE_PROOF=PASS

Validation run on this head:

swiftc /tmp/.../ShareAttachmentSummary.swift /tmp/.../main.swift -o /tmp/.../share-proof && /tmp/.../share-proof
git diff --check

Fix since the prior review:

  • Moved block-reason resolution into ShareAttachmentBlockReason.resolve(...).
  • Image-processing failures are now authoritative before omission warnings.
  • Added focused logic coverage for both branches: processing-failure precedence and omission-only blocking.

Remaining known proof gap: this host still cannot run simulator/device UI proof because it lacks full Xcode and simctl. The PR now has green hosted iOS build/dead-code checks on the previous head; waiting for this head's hosted checks and ClawSweeper re-review.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Solvely-Colin Solvely-Colin self-assigned this Jul 13, 2026
@Solvely-Colin

Copy link
Copy Markdown
Contributor

Exact-head native simulator proof for 5dda9040ac66350805428609bca660dd5373e6f6:

Environment: iPhone 17 Pro simulator, iOS 26.2 (23C54), Xcode 27.0. The installed app's OpenClawGitCommit is the exact PR head above. Both scenarios used the real Photos → Share Sheet → OpenClaw Share Extension path.

Six-image omission path

  • Selected 6 photos in Photos.
  • The extension rendered: Only 3 of 6 images can be sent. Remove omitted items and share again.
  • Send was disabled.
  • After entering Compare all six images, Send remained disabled.
  • XCTest result: Passed (39.91s).

Six selected images show the omission warning with Send disabled

Normal one-image control

  • Selected 1 photo in Photos.
  • After entering Describe this image, Send enabled normally.
  • XCTest result: Passed (27.65s).

A normal one-image share enables Send after draft text is entered

Focused commands:

xcodebuild ... -only-testing:OpenClawUITests/ShareExtensionUITests/testSixSelectedImagesShowOmissionWarningAndKeepSendDisabled test
xcodebuild ... -only-testing:OpenClawUITests/ShareExtensionUITests/testOneSelectedImageStillEnablesSendAfterDraftText test

The UI-test additions were a local proof harness only; no test or product files were pushed to the contributor branch.

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 13, 2026
@steipete
steipete force-pushed the fix/103363-ios-share-omission-proof branch 2 times, most recently from 1b8709d to 9856240 Compare July 13, 2026 02:58
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 13, 2026
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 13, 2026
@steipete
steipete requested a review from a team as a code owner July 13, 2026 08:42
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: telegram Channel integration: telegram channel: zalo Channel integration: zalo app: web-ui App: web-ui gateway Gateway runtime extensions: lobster Extension: lobster cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: codex extensions: google size: XL and removed size: S labels Jul 13, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 13, 2026
@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@jincheng-xydt

Copy link
Copy Markdown
Contributor Author

Closing this PR under my current contribution standard: it is still missing current-head native proof, has a dirty/uncertain merge state, and includes unrelated macOS timeout scope alongside the iOS share fix. I am going to avoid spending more review/CI cycles on a branch that is unlikely to merge in this form.

@steipete

Copy link
Copy Markdown
Contributor

Superseded by #106513 and landed as 6e8df6c0457fc347e9b68a2f7505b953af52082b. Contributor credit preserved. Thanks @jincheng-xydt.

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

Labels

app: ios App: ios app: macos App: macos merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: iOS Share Extension silently truncates shares to 3 images and discards videos/files

3 participants