← 返回首页
fix: remove artificial 500 message limit from sendEach by ezhilnn · Pull Request #1222 · firebase/firebase-admin-java · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

fix: remove artificial 500 message limit from sendEach#1222

Open
ezhilnn wants to merge 4 commits into
firebase:mainfrom
ezhilnn:fix/remove-sendEach-500-limit
Open

fix: remove artificial 500 message limit from sendEach#1222
ezhilnn wants to merge 4 commits into
firebase:mainfrom
ezhilnn:fix/remove-sendEach-500-limit

Conversation

ezhilnn commented Jun 22, 2026

Copy link
Copy Markdown

Fixes #1103
#1103

Problem

sendEach makes an individual HTTP call per message, unlike the
deprecated sendAll which used a single HTTP batch request limited
by Google's batch API. The 500-message cap was copied from sendAll
where it was technically justified — but has no basis in sendEach.

Changes

  • Removed the 500-message hard limit from sendEachOpAsync
  • Updated Javadoc on sendEach and sendEachAsync methods to advise
    callers to chunk very large lists to avoid FCM server-side rate limiting

Testing

  • Removed test asserting 500+ messages throws an exception
  • Added test confirming 501+ messages are accepted

gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Code Review

This pull request removes the 500-message limit from the sendEach and sendEachForMulticast methods in FirebaseMessaging, updating Javadocs and tests accordingly. A critical issue was identified in the new unit test where calling FirebaseMessaging.getInstance() without initializing FirebaseApp throws an IllegalStateException that is silently caught, resulting in a false positive test. It is recommended to use a mock client to properly verify the behavior.

Copy link
Copy Markdown
Member

@chong-shao @Doris-Ge any thoughts on removing this limit?

Copy link
Copy Markdown
Contributor

@lahirumaramba Our team has no objection to removing this limit.

ezhilnn commented Jun 28, 2026

Copy link
Copy Markdown
Author

@lahirumaramba @Doris-Ge can some one approve this

Comment thread src/main/java/com/google/firebase/messaging/FirebaseMessaging.java Outdated Show resolved Hide resolved
ezhilnn and others added 2 commits June 30, 2026 01:12

ezhilnn commented Jun 30, 2026

Copy link
Copy Markdown
Author

@lahirumaramba @Doris-Ge @jamesdaniels @amarkevich can someone approve this

ezhilnn commented Jul 3, 2026

Copy link
Copy Markdown
Author

@lahirumaramba someone approve this !

ezhilnn commented Jul 3, 2026

Copy link
Copy Markdown
Author

@Doris-Ge can you approve this !

ezhilnn requested a review from lahirumaramba July 4, 2026 18:31

ezhilnn commented Jul 6, 2026

Copy link
Copy Markdown
Author

@lahirumaramba waiting for your approval to merge this !

Copy link
Copy Markdown
Member

Thanks @ezhilnn , if we make this change for Java it should also be applied across other Admin SDK languages for consistency. I am checking with the team to follow the correct process for changes across the SDKs. I will share any updates here. Thank you for your patience.

ezhilnn commented Jul 7, 2026

Copy link
Copy Markdown
Author

Do you want my help in any other sdk ? @lahirumaramba

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FirebaseMessaging.sendEach has a limit of 500 messages

3 participants

Footer

© 2026 GitHub, Inc.