Firebase functions SDK 1.0.0 storage.onFinalize() not working as expected

后端 未结 1 1692
暗喜
暗喜 2021-01-14 05:22

I use Firebase function to detect an upload event to Storage and write the download URL to the database like so:

exports.processFile = functions.storage.obje         


        
相关标签:
1条回答
  • 2021-01-14 05:26

    Before SDK 1.0 there was only the onChange() event. It fired for all changes to the storage object and one had to test resourceState in the object metadata to determine if the change was a creation, update, or deletion.

    In SDK 1.0, onChange() has been replaced by four events, eliminating the need to test the value of resourceState:

    • onArchive()
    • onDelete()
    • onFinalize()
    • onMetadataUpdate()

    Although the documentation for ObjectMetadata still shows resourceState, my guess is that it has been removed from SDK 1.0 because it is no longer needed.

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