Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FCM send_message return type is not compatible with previous output #722

Open
sevdog opened this issue May 8, 2024 · 1 comment
Open

Comments

@sevdog
Copy link
Contributor

sevdog commented May 8, 2024

The implementation with firebase SDK has changed the output of the send_message method

Before it was a dict

return ret[0] if len(ret) == 1 else ret
else:
return _cm_send_request(None, data, cloud_type=cloud_type, **kwargs)

Now it is a BatchResponse

return messaging.BatchResponse(ret)
else:
return messaging.BatchResponse([])

This means that any code which relies on the output to be a dict now need to work-around the new type.

This is a breaking change which should have been highlighted or avoided.

@sevdog
Copy link
Contributor Author

sevdog commented May 11, 2024

My point is that previously it was possible to handle the output of different Device (ie: WebpushDevice and GCMDevice) with the same code because they were returning dict/list[dict] according if you were calling the method on a single instance or on the queryset.

Now the code should be reworked to hande the BatchResponse from firebase SDK.

My question is: is this project willing to keep a common API for .send_message output or is it letting any device kind to provide a different output for such method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant