Skip to content

One live activity takes every incoming share - #496

Open
samoylenkodmitry wants to merge 1 commit into
mainfrom
fix/incoming-share-one-activity
Open

One live activity takes every incoming share#496
samoylenkodmitry wants to merge 1 commit into
mainfrom
fix/incoming-share-one-activity

Conversation

@samoylenkodmitry

Copy link
Copy Markdown
Owner

The library manifest gave CranposeActivity no launch mode. A share picked in the system sheet then made a second activity in a new task, and that second activity started a second native loop in the same process: the loop waker and the platform service handles are process statics, so the second register overwrote the first. The shared item went to the collector of the hidden first instance, and the visible second instance showed an empty application. Reproduced with CranScan 1.0.19 on a Pixel 9 Pro and on an emulator.

The activity now declares launchMode singleTask, so every cranpose application keeps one live instance: a share goes to it over onNewIntent, or starts it cold, and the inbox backlog holds items published before the first collector registers. An application manifest can still override the attribute in its own activity entry.

Four integration tests in crates/cranpose-services/tests/incoming_share_delivery.rs pin delivery on the cold, warm, mid-render, and between-compositions roads. The share road also leaves a short trail now: the Java side logs the uri count and the skip reasons, the inbox logs backlog and delivery, and a JNI string that does not decode logs a warning instead of returning in silence.

Verified end to end with CranScan on a Pixel 9 Pro through the Photos share sheet: one activity record, the image imports, the document shows with the parsed sum. cargo test, fmt, and clippy are clean for the touched crates.

🤖 Generated with Claude Code

@samoylenkodmitry
samoylenkodmitry force-pushed the fix/incoming-share-one-activity branch from 7393866 to 5816b5d Compare August 27, 2026 16:01
The library manifest gave CranposeActivity no launch mode. A share picked
in the system sheet then made a second activity in a new task, and that
second activity started a second native loop in the same process. The
shared item went to the collector of the hidden first instance, and the
visible second instance showed an empty application.

The activity now declares launchMode singleTask: a share goes to the one
live instance over onNewIntent, or starts it cold. The cold road keeps
the item in the inbox backlog until the first collector registers; four
integration tests pin the delivery on the cold, warm, mid-render and
between-compositions roads.

The share road also leaves a short trail now: the Java side logs the
count and the skip reasons, the inbox logs backlog and delivery, and a
JNI string that does not decode logs a warning instead of returning in
silence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@samoylenkodmitry
samoylenkodmitry force-pushed the fix/incoming-share-one-activity branch from 5816b5d to fd1ccf7 Compare August 27, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant