-
Notifications
You must be signed in to change notification settings - Fork 244
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
Override endpoint does not work for Batch requests #385
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
We can look into fixing it in a future release. But as usual I'd highly recommend against testing your code this way (see #219, #379). You should use blackbox testing with custom interfaces for all local testing. The RPC calls made by the SDK is an internal implementation detail, and might change in the future. |
@hiranya911 to follow up this issue, blackbox testing shouldn't require you to modify the internals of an application to mock out external dependencies just for the purpose of testing, as this would be peering into the black box and writing code just to satisfy your tests (and running the service in a mode that does not match how it actually functions in a production environment). You can indeed interface this out and run a service in a "mock mode", but that means introducing code into a code base that is purely there for test purposes, which is generally considered to be an anti-pattern. |
Certainly not. Developers should only ever rely on our public API. So they can define interfaces like the following:
Now the However, when you run a mock FCM service, and point the SDK to that for testing (like the OP is attempting to), you're relying on a lot more than the SDK's public API. You're also relying on how the SDK communicates with the FCM backend, how the message marshaling/unmarshaling works, and how the backend itself responds to RPCs.
Putting third-party dependencies behind an interfaces is a well established pattern, and is even considered a best practice. From the Go style guide: https://github.com/golang/go/wiki/CodeReviewComments#interfaces |
…ng for the FCM batch endpoint (firebase#385)
Describe your environment
Step 3: Describe the problem
Same setup as #379 and #189, But this time try to send messages using batch api as mentioned here: https://firebase.google.com/docs/cloud-messaging/send-message?authuser=0#send-messages-to-multiple-devices
Still get the error:
Verified that the request is hitting
https://fcm.googleapis.com/batch
Culprit might be here:
https://github.com/firebase/firebase-admin-go/blob/master/messaging/messaging_batch.go#L233
The text was updated successfully, but these errors were encountered: