Skip to content

database: Reference#transaction return type #1606

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

Closed
rhodgkins opened this issue Mar 17, 2022 · 2 comments
Closed

database: Reference#transaction return type #1606

rhodgkins opened this issue Mar 17, 2022 · 2 comments
Assignees

Comments

@rhodgkins
Copy link

rhodgkins commented Mar 17, 2022

[READ] Step 1: Are you in the right place?

  • For issues related to the code in this repository file a Github issue.
  • If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
    template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: macOS
  • Firebase SDK version: 10
  • Firebase Product: database
  • Node.js version: 14
  • NPM version: 8

[REQUIRED] Step 3: Describe the problem

The transaction method on a reference is typed to return Promise<any> as opposed to Promise<{ committed: boolean, snapshot: DataSnapshot }>.

https://github.com/firebase/firebase-js-sdk/blob/a7f4a2eb6ed08596dffe75825bca1a2034bfcd2e/packages/database-types/index.d.ts#L140-L144

This is the same problem in the docs.

I've already raise this in the JS SDK (firebase/firebase-js-sdk#6071) but was told it belong here - I'm not totally sure this is the case though as firebase-admin references @firebase/database-types which is in the firebase/firebase-js-sdk repo...

Steps to reproduce:

See above.

Relevant Code:

See above.

@lahirumaramba
Copy link
Member

Hi @rhodgkins Thank you for reporting this. You are right, this should be addressed in @firebase/database-types.

@hsubox76 does this belong in the firebase-js-sdk repo?

@lahirumaramba
Copy link
Member

Closing this as firebase/firebase-js-sdk#6071 is now reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants