-
Notifications
You must be signed in to change notification settings - Fork 42
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
add batch push publish docs #2480
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks for this, a few comments. I think we also need to include something about:
- What the response looks like, especially for partially failed requests, similar to https://ably-docs-batch-push-qfok2100v.herokuapp.com/docs/api/rest-api?lang=javascript#batch-publish
- Supported parameters or options as in https://ably-docs-batch-push-qfok2100v.herokuapp.com/docs/api/rest-api?lang=javascript#push-publish
- What the limit is per request
10782fa
to
99e185a
Compare
@mschristensen have resolved all the suggestions. regarding your review comment:
the endpoint responds with 201 on success, and a generic error info upon failure. There's actually no client visible partial failure case here because the entire batch is added to the queue - the rest api doesn't discriminate between items within the batch. It's either bad request, server error, or 201 no content.
There aren't any public params or options here so nothing to add.
I've added something to both pages about a 10k limit. The idea was to discern the limit from load testing, hence why i've been holding off from updating this, but it's likely to be 10k in the end so will leave it as that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor suggestions. Can we also add an item to the main 'publish directly' section bullet points to include batch too?
content/push/publish.textile
Outdated
@@ -778,6 +778,66 @@ var notification = new | |||
rest.Push.Admin.Publish(recipient, notification); | |||
``` | |||
|
|||
h3(#via-batch-push-api). Publish via batch push API | |||
|
|||
The batch push API allows you to publish push notifications to multiple devices or browsers in a single request. This is useful when you need to send a large number of distinct push notifications to multiple recipients. If you are publishing the same notification to multiple recipients, prefer publishing "via channels":#via-channels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The batch push API allows you to publish push notifications to multiple devices or browsers in a single request. This is useful when you need to send a large number of distinct push notifications to multiple recipients. If you are publishing the same notification to multiple recipients, prefer publishing "via channels":#via-channels. | |
The batch push API enables you to publish push notifications to multiple devices or browsers in a single request. | |
This is useful when you need to send a large number of distinct push notifications to multiple recipients. If you are publishing the same notification to multiple recipients, publish "via channels":#via-channels instead. |
content/push/publish.textile
Outdated
h3(#via-batch-push-api). Publish via batch push API | ||
|
||
The batch push API allows you to publish push notifications to multiple devices or browsers in a single request. This is useful when you need to send a large number of distinct push notifications to multiple recipients. If you are publishing the same notification to multiple recipients, prefer publishing "via channels":#via-channels. | ||
The batch push endpoint accepts a JSON array of @PushPublishSpec@ objects, each of which contains a @recipient@ or array of recipients, and a @payload@, where @payload@ is the same as the payload you would use in a normal direct publish request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The batch push endpoint accepts a JSON array of @PushPublishSpec@ objects, each of which contains a @recipient@ or array of recipients, and a @payload@, where @payload@ is the same as the payload you would use in a normal direct publish request. | |
The batch push endpoint accepts a JSON array of @PushPublishSpec@ objects, each of which contain a @recipient@ or array of recipients, and a @payload@, where @payload@ is the same as the payload you would use in a normal direct publish request. |
content/push/publish.textile
Outdated
The batch push endpoint accepts a JSON array of @PushPublishSpec@ objects, each of which contains a @recipient@ or array of recipients, and a @payload@, where @payload@ is the same as the payload you would use in a normal direct publish request. | ||
Currently the batch push endpoint allows a maximum of 10,000 recipients per request (recipients are counted per payload, so publishing two payloads to the same recipient counts as two recipients). | ||
|
||
The following example shows how to publish multiple push notifications in one request using the batch API with the generic REST SDK @request@ method: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following example shows how to publish multiple push notifications in one request using the batch API with the generic REST SDK @request@ method: | |
The following example shows how to publish multiple push notifications in one request using the batch API with the generic REST "@request()@":/docs/api/rest-sdk#request method: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
already approved by engineering and need to deploy asap for customer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a minor suggestion
content/api/rest-api.textile
Outdated
h3(#push-publish-batch). Publish via batch push API | ||
|
||
Convenience endpoint to deliver multiple push notification payloads to multiple devices or browsers in a single request by specifying a list of recipients and corresponding payloads. | ||
Currently the batch push endpoint allows a maximum of 10,000 recipients per request (recipients are counted per payload, so publishing two payloads to the same recipient counts as two recipients). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this wording from "recipients" to "notifications" as the thing which is limited?
E.g.: "Currently the batch push endpoint allows a maximum of 10,000 notifications per request (one notification is counted as one payload delivered to one recipient, so publishing two payloads to the same recipient counts as two notifications)."
a74497a
to
4fc07b1
Compare
adds REST API reference and conceptual docs for batch push
see implementation here: https://github.com/ably/realtime/pull/7217
PUB-1319