From 2bf5d1c2ea191ac19cd3e39426c39ab19db50ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Tue, 4 Sep 2018 12:29:00 +0200 Subject: [PATCH] Document payload size for javascript SDK --- src/collections/_documentation/clients/javascript/config.md | 4 +++- src/collections/_documentation/clients/javascript/usage.md | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/collections/_documentation/clients/javascript/config.md b/src/collections/_documentation/clients/javascript/config.md index c9e7cf35378e42..827701a38a6e67 100644 --- a/src/collections/_documentation/clients/javascript/config.md +++ b/src/collections/_documentation/clients/javascript/config.md @@ -299,12 +299,14 @@ Those configuration options are documented below: : `fetch()` init parameters ([https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)). + Setting `keepalive: true` parameter will allow SDK to send events in `unload` and `beforeunload` handlers. + However, it'll also restrict the size of a single event to 64kB, per [fetch specification](https://fetch.spec.whatwg.org/#http-network-or-cache-fetch) (point 8.5). + Defaults: ```javascript { method: 'POST', - keepalive: true, referrerPolicy: 'origin' } ``` diff --git a/src/collections/_documentation/clients/javascript/usage.md b/src/collections/_documentation/clients/javascript/usage.md index 77fc94f9d2bb64..d13959462b44e7 100644 --- a/src/collections/_documentation/clients/javascript/usage.md +++ b/src/collections/_documentation/clients/javascript/usage.md @@ -127,6 +127,10 @@ The `captureMessage`, `captureException`, `context`, and `wrap` functions all al Raven.setTagsContext(tags); // Add back the tags you want to keep. ``` +**Be aware of maximal payload size** - There are times, when you want to send a whole application state as an extra data. +This can be quite a large object, which can easily weigh more than 200kB, which is currently maximamal payload size of a single event sent to Sentry. +When this happens, you'll get an `HTTP Error 413 Payload Too Large` as the server response or (when `keepalive: true` is set as `fetch` parameter) request will stay in `pending` state forever (eg. in Chrome). + `extra` : Arbitrary data to associate with the event.