Skip to content

fix(connectivity_plus): release iOS multi-engine callbacks - #3957

Open
FeliksLv01 wants to merge 2 commits into
fluttercommunity:mainfrom
FeliksLv01:fix/connectivity-plus-ios-lifecycle
Open

fix(connectivity_plus): release iOS multi-engine callbacks#3957
FeliksLv01 wants to merge 2 commits into
fluttercommunity:mainfrom
FeliksLv01:fix/connectivity-plus-ios-lifecycle

Conversation

@FeliksLv01

@FeliksLv01 FeliksLv01 commented Aug 17, 2026

Copy link
Copy Markdown

Description

Fixes iOS lifecycle retention in applications that register connectivity_plus on multiple FlutterEngine instances. The plugin and its connectivity provider currently retain each other through bound callback references. PathMonitorConnectivityProvider and NWPathMonitor have the same retention pattern.

This change uses weak callback captures and publishes the plugin instance through the registrar. Flutter can then invoke detachFromEngine when an engine is deallocated, which clears the EventChannel sink and stops the monitor.

Related Issues

Checklist

  • I read the Contributor Guide and followed the required package-specific branch and PR workflow.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer does not report any problems on this PR.

Validation

  • GitHub Actions: Dart Analyzer and iOS example build passed.
  • Local: melos run format passed without tracked-file changes.
  • Local: flutter pub publish --dry-run for connectivity_plus passed from a clean working tree.
  • The CI pub.dev job fails before testing this change: with Flutter 3.47, its workspace bootstrap marks example/analysis_options.yaml modified in android_intent_plus, connectivity_plus, and package_info_plus; pub rejects each dirty package. This PR does not modify those files.
  • Platform integration jobs remain the source of truth and are running on the PR.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@FeliksLv01

Copy link
Copy Markdown
Author

Closing this premature submission. I will reopen a validated PR with the required template, test results, and issue context.

@FeliksLv01 FeliksLv01 closed this Aug 17, 2026
@FeliksLv01 FeliksLv01 reopened this Aug 17, 2026
@FeliksLv01 FeliksLv01 changed the title fix(connectivity_plus): release iOS engine callbacks fix(connectivity_plus): release iOS multi-engine callbacks Aug 17, 2026
@FeliksLv01

Copy link
Copy Markdown
Author

CI note: the remaining failures are unrelated to the iOS callback lifecycle change in this PR. Flutter 3.47 introduced repository-wide toolchain validation and formatting migrations: some example projects require Gradle/Kotlin upgrades, and Dart 3.13 reformats an existing share_plus test. This PR also temporarily touches three package examples to unblock pub validation, which triggers their package-specific workflows; the package_info_plus iOS integration failure is a pre-existing CocoaPods sandbox/Podfile.lock synchronization issue. The connectivity_plus analyzer, unit tests, pub dry-run, and iOS/macOS example builds pass.

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.

[Bug]: iOS connectivity_plus retains callbacks in multi-FlutterEngine apps

1 participant