Cloud Functions for Firebase onWrite timeout

前端 未结 1 1978
傲寒
傲寒 2021-01-04 12:21

I return transaction promise which should wait for transaction to finish before stopping the function. The transaction executes fine, but the promise seems to never resolve.

相关标签:
1条回答
  • 2021-01-04 12:48

    There was a known issue with older versions of the firebase-admin SDK where Firebase Database references and snapshots couldn't be JSON serialized and thus couldn't be used in return values for Cloud Functions. This includes transaction return values since they also have snapshots.

    Your hack works around the bug; you should also get the fix if you update your version of firebase-admin.

    0 讨论(0)
提交回复
热议问题