Skip to content
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

Closed

Conversation

evandrobubiak
Copy link

  • Implements Transactions for Firestore Transactions in Firestore #59
  • Implements error handling for Firestore errors.
  • Created some tests for Transactions.

@CLAassistant
Copy link

CLAassistant commented Nov 18, 2024

CLA assistant check
All committers have signed the CLA.

}
return Future<T>(() async {
var attempts = 1;
while (true) {
Copy link
Contributor

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(...);
}

Copy link
Collaborator

@rrousselGit rrousselGit left a 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?

@evandrobubiak
Copy link
Author

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.

@rrousselGit
Copy link
Collaborator

Thanks! I understand that this is quite a big change.

@evandrobubiak
Copy link
Author

evandrobubiak commented Nov 25, 2024

I will close this requeset and will open a new one with all new code based on NodeJS official implementation.

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.

4 participants