这是indexloc提供的服务,不要输入任何密码
Skip to content

Storage - listAllWithCompletion calls the completion helper twice if an error occured  #7197

@TPXP

Description

@TPXP

Step 0: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request please use the Feature Request template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general (non-iOS) Firebase discussion, use the firebase-talk
    google group.
  • For backend issues, console issues, and other non-SDK help that does not fall under one
    of the above categories, reach out to
    Firebase Support.
  • Once you've read this section and determined that your issue is appropriate for
    this repository, please delete this section.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.3
  • Firebase SDK version: 7.2.0
  • Installation method: CocoaPods
  • Firebase Component: Storage

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

  • Create a ref for a cloud storage folder the current user cannot list items.
  • Call listAllWithCompletion on this StorageRef
  • Notice the completion helper is called twice: once with the permission denied error, the other time with an empty directory result.

Relevant Code:

Sorry, I suck at ObjC, here's a reproduction with the RNFirebase SDK invertase/react-native-firebase#4688

This issue can be summed up in one question: Is there a missing return here:

... Or did you intend to call the completion helper with the files you got so far if an error occurs?

Since this seems to differ with the behaviour on Android (where the Task class will not allow you to reject and resolve the same task, I think?), I think adding a warning in the documentation could help anyway.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions