Skip to content

when using sendEach with a batch that contains entry x with invalid url, the whole batch fails instead of only x #2467

@jens-dehnert-winkler-ay

Description

[READ] Step 1: Are you in the right place?

  • For issues related to the code in this repository file a Github issue.
  • If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
    template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: aws docker
  • Firebase SDK version: "11.10.1"
  • Firebase Product:
  • Node.js version: node 20
  • NPM version:

[REQUIRED] Step 3: Describe the problem

Expectation: when using sendEach, each message should be treated isolated, as if I would call send for each of the messages myself.
This works fine, if the message is valid. If it is invalid (e.g. the image url does not pass the validation), the whole batch is rejected, even if all other messages are valid.

Steps to reproduce:

calling messaging sendEach function fails for all messages if a single message is invalid.
This is because the loop maps the objects to a synchronous function instead of using async in l/ 297.

Relevant Code:

(

public sendEach(messages: Message[], dryRun?: boolean): Promise<BatchResponse> {
)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions