One live activity takes every incoming share - #496
Open
samoylenkodmitry wants to merge 1 commit into
Open
Conversation
samoylenkodmitry
force-pushed
the
fix/incoming-share-one-activity
branch
from
August 27, 2026 16:01
7393866 to
5816b5d
Compare
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
force-pushed
the
fix/incoming-share-one-activity
branch
from
August 27, 2026 16:11
5816b5d to
fd1ccf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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