Skip to content

Realtime database runTransaction can't use async function as transactionUpdate #6970

@Legend-Master

Description

@Legend-Master

[REQUIRED] Describe your environment

  • Operating System version: Windows_NT x64 10.0.19045
  • Browser version: Chrome 109.0.5414.75
  • Firebase SDK version: 9.16.0
  • Firebase Product: database (realtime database) (auth, database, storage, etc)

[REQUIRED] Describe the problem

Steps to reproduce:

Can't use async function in runTransaction, return value will be counted as null (remove everything from that path)

Relevant Code:

const result = await runTransaction(ref(db, 'test'), async (currentData) => {
	return 1
})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions