Skip to content

fix(android): serialize direct GATT connection admission - #25

Open
ODevStudio wants to merge 8 commits into
mainfrom
fix/871-android-direct-connect-admission
Open

ODevStudio wants to merge 8 commits into
mainfrom
fix/871-android-direct-connect-admission

Conversation

@ODevStudio

@ODevStudio ODevStudio commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Part 2/5 of decentespresso/decaid#871; related #26.

  • Serialize Android direct connection establishment with a per-plugin FIFO. Established peers keep independent reads, writes and notifications.
  • Cancel queued requests without creating a GATT. Hold a failed/cancelled native owner until its exact GATT closes.
  • Fence stale callbacks and adapter-off work by owner identity and epoch.
  • Preserve existing deadlines, cooldowns and autoConnect=true behavior.

This hardens recovery; it does not establish the cause of the original field timeout. No global GATT mutex, adapter reset, heartbeat, or scale-protocol change.

Simplification

Removed the separate scenario runner/script and duplicate cases: 245 fewer lines. Unique ownership tests now run directly in the existing Android test job; plugin-level recovery and healthy-peer regressions remain.

Verification

At 6184659: analysis clean; Flutter 136 passed / 13 skipped; Android 63 passed. Android counts now include individually reported ownership cases previously grouped under one runner.
Final cross-platform CI passed.

Deferred: affected Android + DE1 + original-scale acceptance in decentespresso/decaid#877. PR remains draft.

Integration

PR #28 supplies native cleanup integration and end-to-end attempt cancellation. A caller timeout is not teardown confirmation. Unconfirmed native cleanup must remain blocked rather than force-close a healthy peer.

Design and scope | Acceptance evidence

Contributor Note

AI-assisted implementation and review. Maintainer review and affected-device acceptance remain open; nothing is merged.

Keep direct connection ownership through native success or GATT close, cancel
queued/cooldown attempts safely, and fence stale callbacks by attempt and GATT
identity. Preserve established links, per-device GATT queues and host retry
policy. Add deterministic scheduler and Android plugin regression coverage.

Related: decentespresso/decaid#871
Hardware validation remains required.

Copy link
Copy Markdown
Collaborator Author

The interrupted Decaid #871 work has now been split into bounded, linked work packages. This draft was recovered and is the reusable candidate; no duplicate fork PR has been opened.

Tracking overview: decentespresso/decaid#871

Important baseline update: decentespresso/decaid#867 now preserves a healthy original-scale connection for displayOff after the #874 findings (inspected head 0b3da3942c55940d40939fc66cdee6d0d5f847f8). Baseline and candidate tests must include the same corrected scale-power behavior; explicit disconnect mode is separate.

At inspected head ac8427a466f122a072756639a4a850ef4cafef51, the reported JVM scenarios and current green checks are useful evidence, but native Android build/integration coverage and affected-device results still need explicit verification under #27 and the final acceptance issue. Cross-device overlap remains a candidate cause, not a hardware-proven explanation for the initial timeout. The decision package may prefer a narrower or different fix.

This comment only links the plan; it does not change the draft status, approve the implementation, or claim new test execution. Dependency work remains in this fork, not upstream; no dart_js change is currently justified.

@ODevStudio
ODevStudio force-pushed the fix/871-android-direct-connect-admission branch from e8096dc to a5cc8dd Compare September 16, 2026 10:36
@ODevStudio
ODevStudio marked this pull request as ready for review September 17, 2026 09:57
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