Skip to content

fix(database, apple): ensure platform channel is invoked on main thread - #11650

Merged
russellwheatley merged 1 commit into
masterfrom
database-11628
Oct 3, 2023
Merged

fix(database, apple): ensure platform channel is invoked on main thread#11650
russellwheatley merged 1 commit into
masterfrom
database-11628

Conversation

@russellwheatley

@russellwheatley russellwheatley commented Sep 29, 2023

Copy link
Copy Markdown
Member

Description

Receiving this warning in the console without this fix:

[VERBOSE-2:shell.cc(1004)] The 'plugins.flutter.io/firebase_database' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.
See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.

This just ensures platform channel call in transaction operates on the main thread to comply with Flutter requirement. See documentation about executing platform channel requests on the main thread: https://docs.flutter.dev/platform-integration/platform-channels?tab=type-mappings-obj-c-tab#channels-and-platform-threading

Related Issues

fixes #11628

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

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

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

Labels

None yet

Projects

None yet

3 participants