firebase-admin-python icon indicating copy to clipboard operation
firebase-admin-python copied to clipboard

[FR] Allow `messaging.subscribe_to_topic` to return more verbose information on failure

Open kunambi opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe. It frustrates our team that each time our mobile app is updated and our users open the app, a new device_id is generated. We are saving this new device_id to the user, because we can't know for sure that the user haven't just bought a new phone and installed the app into that new phone as well. This leads to the problem that when we subscribe users to a topic, with all their device ids, we get many Errors ['NOT_FOUND', 'NOT_FOUND', 'NOT_FOUND', 'NOT_FOUND', 'NOT_FOUND', 'NOT_FOUND'] returned.

Describe the solution you'd like We'd like that the API returns a list of failed device_ids so that we can delete those from our database. We'd love to see this extended to messaging.unsubscribe_from_topic as well.

Describe alternatives you've considered Digging through the firebase code doesn't give any hints that the information we're looking for is discarded in transit.

Additional context Code example:

from firebase_admin import messaging

def do_subscribe(tokens, topic):
    response = messaging.subscribe_to_topic(tokens, topic)
    if response.failure_count > 0:
        logger.error(
            f"Errors {list(map(lambda e: e.reason, response.errors))}",
            exc_info=False,
        )

kunambi avatar Mar 30 '23 08:03 kunambi

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Mar 30 '23 08:03 google-oss-bot

Hi @kunambi we would like to clarify: does "device_id" mean the FCM registration token in the feature description?

chong-shao avatar Apr 07 '23 21:04 chong-shao

Dear @chong-shao, yes that's what I mean. Sorry for using wrong terminology.

kunambi avatar Apr 15 '23 21:04 kunambi

It has been 3 weeks, just checking in if further information is needed?

kunambi avatar May 09 '23 00:05 kunambi

Shameless bump.

Or is this a "WONTFIX" issue?

kunambi avatar Aug 02 '23 10:08 kunambi

Shameless bump.

It's almost 6 months since this issue was raised. Any idea on what will happen?

kunambi avatar Sep 08 '23 13:09 kunambi

+1 this would be useful

davidemerritt avatar May 09 '24 21:05 davidemerritt