-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements Transactions in Firestore #62
Implements Transactions in Firestore #62
Conversation
evandrobubiak
commented
Nov 18, 2024
- Implements Transactions for Firestore Transactions in Firestore #59
- Implements error handling for Firestore errors.
- Created some tests for Transactions.
Removed old Todo.
} | ||
return Future<T>(() async { | ||
var attempts = 1; | ||
while (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the following would be a more defensive style:
var attempts = 0;
while(++attempts <= maxAttempts) {
and starting line 222:
if (attempts >= maxAttempts) {
return Future.error(...);
}
packages/dart_firebase_admin/lib/src/google_cloud_firestore/firestore.dart
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate, but for the sake of maintenance we're trying to stick to a port of the official NodeJS implementation as much as possible.
Cf https://github.com/googleapis/nodejs-firestore/blob/07a88420062c428b04d61638c6ba432422e01652/dev/src/transaction.ts#L79
https://github.com/googleapis/nodejs-firestore/blob/07a88420062c428b04d61638c6ba432422e01652/dev/src/transaction.ts#L582
Do you mind updating your PR such that it is a port of the original code?
Got it. I'll do my best to maintain compatibility. Thansk for the feed back. |
Thanks! I understand that this is quite a big change. |
I will close this requeset and will open a new one with all new code based on NodeJS official implementation. |