Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@kroikie
Copy link
Contributor

@kroikie kroikie commented Jun 4, 2019

Description

In coming versions of the Flutter engine calls to the Dart side from the Java side must be done on the UI thread. The Firestore plugin implements transactions by making calls to the Dart side from the Java side. This change ensures that those calls are made on the UI thread.

Related Issues

Resolves: flutter/flutter#32657

@kroikie kroikie changed the title Invoke on ui thread only [cloud_firestore] Invoke on ui thread only Jun 4, 2019
public class FlutterFirebaseAppRegistrar implements ComponentRegistrar {
private static final String LIBRARY_NAME = "flutter-firebase_cloud_firestore";
private static final String LIBRARY_VERSION = "0.12.1";
private static final String LIBRARY_NAME = "flutter-fire-fst";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be mentioned in changelog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -1,3 +1,9 @@
## 0.12.2

* Ensure that all channel calls to the Dart side from the Java side are done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to mention that this is an Android-only change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* Ensure that all channel calls to the Dart side from the Java side are done
on the UI thread. This change allows Transactions to work with upcoming
Engine restrictions, which require channel calls be made on the UI thread.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this take into account that Firestore's Android SDK will not allow transactions on the UI thread?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transaction itself is not being executed on the UI thread, only the message being passed over the channel from native side to Dart side is being done on the UI thread.

@ride4sun
Copy link

ride4sun commented Jul 18, 2019

This does not fix flutter/flutter#18870

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in cloud_firestore and firebase_database Android Transactions

5 participants