From 03804fb4b95ff535c4d9a9879ed695093bf42fb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 15:43:23 +0100 Subject: [PATCH] Bump @sentry/utils from 5.24.2 to 6.13.2 (#39932) * Bump @sentry/utils from 5.24.2 to 6.13.2 Bumps [@sentry/utils](https://github.com/getsentry/sentry-javascript) from 5.24.2 to 6.13.2. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/5.24.2...6.13.2) --- updated-dependencies: - dependency-name: "@sentry/utils" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Chore: fix type checks by updating buffer.add to add a function instead of a promise * kick drone Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ashley Harrison --- package.json | 2 +- .../transports/CustomEndpointTransport.ts | 39 ++++++++++--------- yarn.lock | 19 +++++---- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index e19efa8d0a3..297793a1648 100644 --- a/package.json +++ b/package.json @@ -237,7 +237,7 @@ "@reduxjs/toolkit": "1.6.1", "@sentry/browser": "5.25.0", "@sentry/types": "5.24.2", - "@sentry/utils": "5.24.2", + "@sentry/utils": "6.13.2", "@types/ol": "^6.5.1", "@visx/event": "2.1.0", "@visx/gradient": "2.1.0", diff --git a/public/app/core/services/echo/backends/sentry/transports/CustomEndpointTransport.ts b/public/app/core/services/echo/backends/sentry/transports/CustomEndpointTransport.ts index b9551fe69a1..3e4efa51943 100644 --- a/public/app/core/services/echo/backends/sentry/transports/CustomEndpointTransport.ts +++ b/public/app/core/services/echo/backends/sentry/transports/CustomEndpointTransport.ts @@ -75,28 +75,29 @@ export class CustomEndpointTransport implements BaseTransport { } return this._buffer.add( - new SyncPromise((resolve, reject) => { - window - .fetch(sentryReq.url, options) - .then((response) => { - const status = Status.fromHttpCode(response.status); + () => + new SyncPromise((resolve, reject) => { + window + .fetch(sentryReq.url, options) + .then((response) => { + const status = Status.fromHttpCode(response.status); - if (status === Status.Success) { - resolve({ status }); - return; - } + if (status === Status.Success) { + resolve({ status }); + return; + } - if (status === Status.RateLimit) { - const now = Date.now(); - const retryAfterHeader = response.headers.get('Retry-After'); - this._disabledUntil = new Date(now + parseRetryAfterHeader(now, retryAfterHeader)); - logger.warn(`Too many requests, backing off till: ${this._disabledUntil}`); - } + if (status === Status.RateLimit) { + const now = Date.now(); + const retryAfterHeader = response.headers.get('Retry-After'); + this._disabledUntil = new Date(now + parseRetryAfterHeader(now, retryAfterHeader)); + logger.warn(`Too many requests, backing off till: ${this._disabledUntil}`); + } - reject(response); - }) - .catch(reject); - }) + reject(response); + }) + .catch(reject); + }) ); } } diff --git a/yarn.lock b/yarn.lock index 924b4683cb9..3cc5b10e3ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3369,13 +3369,10 @@ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.25.0.tgz#3bcf95e118d655d3f4e8bfa5f0be2e1fe4ea5307" integrity sha512-8M4PREbcar+15wrtEqcwfcU33SS+2wBSIOd/NrJPXJPTYxi49VypCN1mZBDyWkaK+I+AuQwI3XlRPCfsId3D1A== -"@sentry/utils@5.24.2": - version "5.24.2" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.24.2.tgz#90b7dff939bbbf4bb8edcac6aac2d04a0552af80" - integrity sha512-oPGde4tNEDHKk0Cg9q2p0qX649jLDUOwzJXHKpd0X65w3A6eJByDevMr8CSzKV9sesjrUpxqAv6f9WWlz185tA== - dependencies: - "@sentry/types" "5.24.2" - tslib "^1.9.3" +"@sentry/types@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.13.2.tgz#8388d5b92ea8608936e7aae842801dc90e0184e6" + integrity sha512-6WjGj/VjjN8LZDtqJH5ikeB1o39rO1gYS6anBxiS3d0sXNBb3Ux0pNNDFoBxQpOhmdDHXYS57MEptX9EV82gmg== "@sentry/utils@5.25.0": version "5.25.0" @@ -3385,6 +3382,14 @@ "@sentry/types" "5.25.0" tslib "^1.9.3" +"@sentry/utils@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.13.2.tgz#fb8010e7b67cc8c084d8067d64ef25289269cda5" + integrity sha512-foF4PbxqPMWNbuqdXkdoOmKm3quu3PP7Q7j/0pXkri4DtCuvF/lKY92mbY0V9rHS/phCoj+3/Se5JvM2ymh2/w== + dependencies: + "@sentry/types" "6.13.2" + tslib "^1.9.3" + "@sideway/address@^4.1.0": version "4.1.2" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.2.tgz#811b84333a335739d3969cfc434736268170cad1"