firebase / firebase/firebase-js-sdk

Realtime database `runTransaction` can't use async function as `transactionUpdate`

Open
#6,970 2 comments 0 reactions 0 assignees View on GitHub
api: database feature request v9
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [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:

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.