Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
creativecreatorormaybenot committed Sep 3, 2019
1 parent 323e71c commit 815bbd7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 19 deletions.
4 changes: 4 additions & 0 deletions packages/cloud_firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.12.9+3

* Updated error handling on Android for transactions to prevent crashes.

## 0.12.9+2

* Fix flaky integration test for `includeMetadataChanges`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public void run() {
result.success(snapshotMap);
}
});
} catch (final FirebaseFirestoreException e) {
} catch (final Exception e) {
activity.runOnUiThread(
new Runnable() {
@Override
Expand Down Expand Up @@ -506,7 +506,7 @@ public void run() {
result.success(null);
}
});
} catch (final IllegalStateException e) {
} catch (final Exception e) {
activity.runOnUiThread(
new Runnable() {
@Override
Expand All @@ -529,14 +529,24 @@ public void run() {
@Override
protected Void doInBackground(Void... voids) {
Map<String, Object> data = (Map<String, Object>) arguments.get("data");
transaction.set(getDocumentReference(arguments), data);
activity.runOnUiThread(
new Runnable() {
@Override
public void run() {
result.success(null);
}
});
try {
transaction.set(getDocumentReference(arguments), data);
activity.runOnUiThread(
new Runnable() {
@Override
public void run() {
result.success(null);
}
});
} catch (final Exception e) {
activity.runOnUiThread(
new Runnable() {
@Override
public void run() {
result.error("Error performing Transaction#set", e.getMessage(), null);
}
});
}
return null;
}
}.execute();
Expand All @@ -549,14 +559,24 @@ public void run() {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... voids) {
transaction.delete(getDocumentReference(arguments));
activity.runOnUiThread(
new Runnable() {
@Override
public void run() {
result.success(null);
}
});
try {
transaction.delete(getDocumentReference(arguments));
activity.runOnUiThread(
new Runnable() {
@Override
public void run() {
result.success(null);
}
});
} catch (final Exception e) {
activity.runOnUiThread(
new Runnable() {
@Override
public void run() {
result.error("Error performing Transaction#delete", e.getMessage(), null);
}
});
}
return null;
}
}.execute();
Expand Down
2 changes: 1 addition & 1 deletion packages/cloud_firestore/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database
live synchronization and offline support on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_firestore
version: 0.12.9+2
version: 0.12.9+3

flutter:
plugin:
Expand Down

0 comments on commit 815bbd7

Please sign in to comment.