Better Error handling for empty token list in Messaging send_each_multicast
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start in firebase_admin/messaging.py at send_each_multicast, around the linked line, and trace how an empty device-token list reaches send_each and the thread pool. Compare the alternative location in send_each. Done means an empty list produces a descriptive ValueError instead of the current unknown max_workers error.
Written by the indexing model from the issue text.
Description
Problem
Non-descriptive error message returned when sending multicast message with empty device token list. Currently the empty list of tokens propagates throughout the code and results in an Unknown Error type with a vague error message as follows: "Unknown error while making remote service calls: max_workers must be greater than 0". This error seems to originate here as the Threadpool is created with max_workers based on the length of the messages parameter, which is ultimately dependent on the number of tokens in the Message object.
Describe the solution you'd like
Check the length of device tokens directly in the send_each_multicast method and return a descriptive ValueError in the event of an empty list. here
Describe alternatives you've considered
Check the length of the message directly in the send_each class method here.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 359
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-admin-python
-
api: remoteconfig
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
firebase/firebase-admin-python#957 · 1 comment ·
-
api: database type: feature request
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
firebase/firebase-admin-python#978 · 1 comment ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) Openapi: auth
firebase/firebase-admin-python#949 · 2 comments · 1 reaction · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 43/100
firebase/firebase-admin-python#945 · 1 comment · 1 reaction ·
All issues in firebase/firebase-admin-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·