Skip to content

Commit faeeea4

Browse files
authored
Merge branch 'master' into abhi-browser-scenarios
2 parents e80ee5b + 4887f98 commit faeeea4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+966
-987
lines changed

.craft.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@ minVersion: '0.23.1'
22
changelogPolicy: simple
33
preReleaseCommand: bash scripts/craft-pre-release.sh
44
targets:
5-
- name: npm
6-
- name: github
7-
includeNames: /^sentry-.*$/
5+
- name: aws-lambda-layer
6+
includeNames: /^sentry-node-serverless-\d+(\.\d+)*\.zip$/
7+
layerName: SentryNodeServerlessSDK
8+
compatibleRuntimes:
9+
- name: node
10+
versions:
11+
- nodejs10.x
12+
- nodejs12.x
13+
- nodejs14.x
14+
license: MIT
815
- name: gcs
916
includeNames: /.*\.js.*$/
1017
bucket: sentry-js-sdk
1118
paths:
1219
- path: /{{version}}/
1320
metadata:
1421
cacheControl: 'public, max-age=31536000'
22+
- name: github
23+
includeNames: /^sentry-.*$/
24+
- name: npm
1525
- name: registry
1626
sdks:
1727
'npm:@sentry/browser':
@@ -34,13 +44,3 @@ targets:
3444
onlyIfPresent: /^sentry-wasm-.*\.tgz$/
3545
'npm:@sentry/nextjs':
3646
onlyIfPresent: /^sentry-nextjs-.*\.tgz$/
37-
- name: aws-lambda-layer
38-
includeNames: /^sentry-node-serverless-\d+(\.\d+)*\.zip$/
39-
layerName: SentryNodeServerlessSDK
40-
compatibleRuntimes:
41-
- name: node
42-
versions:
43-
- nodejs10.x
44-
- nodejs12.x
45-
- nodejs14.x
46-
license: MIT

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
4747
- name: Install dependencies
4848
if: steps.cache_dependencies.outputs.cache-hit == ''
49-
run: yarn install
49+
run: yarn install --ignore-engines
5050
outputs:
5151
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
5252

@@ -102,6 +102,8 @@ jobs:
102102
uses: actions/checkout@v2
103103
- name: Set up Node
104104
uses: actions/setup-node@v1
105+
with:
106+
node-version: '12'
105107
- name: Check dependency cache
106108
uses: actions/cache@v2
107109
with:

.vscode/launch.json

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,47 @@
5151

5252

5353
// @sentry/nextjs - Run a specific integration test file
54-
// Must have file in currently active tab when hitting the play button
54+
// Must have test file in currently active tab when hitting the play button, and must already have run `yarn` in test app directory
5555
{
5656
"name": "Debug @sentry/nextjs integration tests - just open file",
5757
"type": "node",
5858
"cwd": "${workspaceFolder}/packages/nextjs",
5959
"request": "launch",
60-
// TODO create a build task
61-
// "preLaunchTask": "yarn build",
62-
63-
// this is going straight to `server.js` (rather than running the tests through yarn) in order to be able to skip
64-
// having to reinstall dependencies on every new test run
60+
// since we're not using the normal test runner, we need to make sure we're using the current version of all local
61+
// SDK packages and then manually rebuild the test app
62+
"preLaunchTask": "Prepare nextjs integration test app for debugging",
63+
// running `server.js` directly (rather than running the tests through yarn) allows us to skip having to reinstall
64+
// dependencies on every new test run
6565
"program": "${workspaceFolder}/packages/nextjs/test/integration/test/server.js",
6666
"args": [
6767
"--debug",
6868
// remove these two lines to run all integration tests
6969
"--filter",
7070
"${fileBasename}"
7171
],
72-
"sourceMaps": true,
72+
7373
"skipFiles": [
74-
"<node_internals>/**", "**/tslib/**"
74+
"<node_internals>/**",
75+
// this prevents us from landing in a neverending cycle of TS async-polyfill functions as we're stepping through
76+
// our code
77+
"${workspaceFolder}/node_modules/tslib/**/*"
7578
],
79+
"sourceMaps": true,
80+
// this controls which files are sourcemapped
81+
"outFiles": [
82+
// our SDK code
83+
"${workspaceFolder}/**/dist/**/*.js",
84+
// the built test app
85+
"${workspaceFolder}/packages/nextjs/test/integration/.next/**/*.js",
86+
"!**/node_modules/**"
87+
],
88+
"resolveSourceMapLocations": [
89+
"${workspaceFolder}/**/dist/**",
90+
"${workspaceFolder}/packages/nextjs/test/integration/.next/**",
91+
"!**/node_modules/**"
92+
],
93+
"internalConsoleOptions": "openOnSessionStart"
94+
7695
},
7796
]
7897
}

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558 for documentation about `tasks.json` syntax
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"label": "Prepare nextjs integration test app for VSCode debugger",
7+
"type": "npm",
8+
"script": "predebug",
9+
"path": "packages/nextjs/test/integration/",
10+
"detail": "Link the SDK (if not already linked) and build test app"
11+
}
12+
]
13+
}

CHANGELOG.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 6.15.0
8+
9+
- fix(browser): Capture stacktrace on `DOMExceptions`, if possible (#4160)
10+
- fix(nextjs): Delay error propagation until `withSentry` is done (#4027)
11+
12+
Work in this release contributed by @nowylie. Thank you for your contribution!
13+
14+
## 6.14.3
15+
16+
- Revert: ref(utils): Use type predicates in `is` utility functions (#4124)
17+
18+
## 6.14.2
19+
20+
- feat(awslambda) : Capture errors individually on sqs partial batch failure (#4130)
21+
- feat(gatsby): Upload source maps automatically when sentry-cli is configured (#4109)
22+
- fix(nextjs): Prevent `false API resolved without sending a response` warning (#4139)
23+
- fix(vue): Merge default and manual hooks while creating mixins. (#4132)
24+
- ref(utils): Use type predicates in `is` utility functions (#4124)
25+
26+
Work in this release contributed by @J4YF7O. Thank you for your contribution!
27+
728
## 6.14.1
829

930
- feat(gatsby): Support Gatsby v4 (#4120)
@@ -32,7 +53,7 @@
3253
- fix(tracing): Update paths for DB drivers auto-instrumentation (#4083)
3354
- fix(vue): Move ROOT_SPAN_TIMER into Vue context. (#4081)
3455

35-
Features, fixes, and improvements in this release have been contributed by: @tmilar, @deammer, @freekii. Thank you for your contributions!
56+
Work in this release contributed by @tmilar, @deammer, and @freekii. Thank you for your contributions!
3657

3758
## 6.13.3
3859

@@ -602,7 +623,7 @@ during SDK initialization.
602623

603624
- [react] feat: Expose eventId on ErrorBoundary component (#2704)
604625
- [node] fix: Extract transaction from nested express paths correctly (#2714)
605-
- [tracing] feat: Pick up sentry-trace in JS <meta/> tag (#2703)
626+
- [tracing] feat: Pick up sentry-trace in JS `<meta/>` tag (#2703)
606627
- [tracing] fix: Respect fetch headers (#2712) (#2713)
607628
- [tracing] fix: Check if performance.getEntries() exists (#2710)
608629
- [tracing] fix: Add manual Location typing (#2700)
@@ -908,7 +929,7 @@ removed in the future. If you are only using the `Tracing` integration there is
908929

909930
## 5.4.2
910931

911-
- [core] fix: Allow Integration<T> constructor to have arguments
932+
- [core] fix: Allow `Integration<T>` constructor to have arguments
912933
- [browser] fix: Vue breadcrumb recording missing in payload
913934
- [node] fix: Force agent-base to be at version 4.3.0 to fix various issues. Fix #1762, fix #2085
914935
- [integrations] fix: Tracing integration fetch headers bug where trace header is not attached if there are no options.
@@ -1017,7 +1038,7 @@ This major bump brings a lot of internal improvements. Also, we extracted some i
10171038
in their own package called `@sentry/integrations`. For a detailed guide how to upgrade from `4.x` to `5.x` refer to our
10181039
[migration guide](https://github.com/getsentry/sentry-javascript/blob/master/MIGRATION.md).
10191040

1020-
**Migration from v4**
1041+
### Migration from v4
10211042

10221043
If you were using the SDKs high level API, the way we describe it in the docs, you should be fine without any code
10231044
changes. This is a **breaking** release since we removed some methods from the public API and removed some classes from
@@ -1099,7 +1120,7 @@ the default export.
10991120

11001121
## 5.0.0-beta1
11011122

1102-
**Migration from v4**
1123+
### Migration from v4
11031124

11041125
This major bump brings a lot of internal improvements. This is a **breaking** release since we removed some methods from
11051126
the public API and removed some classes from the default export.
@@ -1195,7 +1216,7 @@ the public API and removed some classes from the default export.
11951216
## 4.5.2
11961217

11971218
- [utils] fix: Decycling for objects to no produce an endless loop
1198-
- [browser] fix: <unlabeled> event for unhandledRejection
1219+
- [browser] fix: `<unlabeled>` event for unhandledRejection
11991220
- [loader] fix: Handle unhandledRejection the same way as it would be thrown
12001221

12011222
## 4.5.1

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "3.4.0",
3-
"version": "6.14.1",
3+
"version": "6.15.0",
44
"packages": "packages/*",
55
"npmClient": "yarn",
66
"useWorkspaces": true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@types/sinon": "^7.0.11",
5858
"chai": "^4.1.2",
5959
"codecov": "^3.6.5",
60-
"eslint": "7.27.0",
60+
"eslint": "7.32.0",
6161
"jest": "^24.7.1",
6262
"karma-browserstack-launcher": "^1.5.1",
6363
"karma-firefox-launcher": "^1.1.0",

packages/angular/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular",
3-
"version": "6.14.1",
3+
"version": "6.15.0",
44
"description": "Official Sentry SDK for Angular",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
@@ -16,14 +16,14 @@
1616
"access": "public"
1717
},
1818
"peerDependencies": {
19-
"@angular/common": "10.x || 11.x || 12.x",
20-
"@angular/core": "10.x || 11.x || 12.x",
21-
"@angular/router": "10.x || 11.x || 12.x"
19+
"@angular/common": "10.x || 11.x || 12.x || 13.x",
20+
"@angular/core": "10.x || 11.x || 12.x || 13.x",
21+
"@angular/router": "10.x || 11.x || 12.x || 13.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "6.14.1",
25-
"@sentry/types": "6.14.1",
26-
"@sentry/utils": "6.14.1",
24+
"@sentry/browser": "6.15.0",
25+
"@sentry/types": "6.15.0",
26+
"@sentry/utils": "6.15.0",
2727
"rxjs": "^6.6.0",
2828
"tslib": "^1.9.3"
2929
},

packages/browser/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "6.14.1",
3+
"version": "6.15.0",
44
"description": "Official Sentry SDK for browsers",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -16,13 +16,13 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/core": "6.14.1",
20-
"@sentry/types": "6.14.1",
21-
"@sentry/utils": "6.14.1",
19+
"@sentry/core": "6.15.0",
20+
"@sentry/types": "6.15.0",
21+
"@sentry/utils": "6.15.0",
2222
"tslib": "^1.9.3"
2323
},
2424
"devDependencies": {
25-
"@sentry-internal/eslint-config-sdk": "6.14.1",
25+
"@sentry-internal/eslint-config-sdk": "6.15.0",
2626
"@types/eslint": "^7.2.0",
2727
"@types/md5": "2.1.33",
2828
"btoa": "^1.2.1",

packages/browser/src/eventbuilder.ts

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,42 @@ export function eventFromUnknownInput(
6565
): Event {
6666
let event: Event;
6767

68-
if (isErrorEvent(exception)) {
68+
if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {
6969
// If it is an ErrorEvent with `error` property, extract it to get actual Error
70+
const errorEvent = exception as ErrorEvent;
7071
// eslint-disable-next-line no-param-reassign
71-
exception = exception.error;
72-
event = eventFromStacktrace(computeStackTrace(exception));
72+
exception = errorEvent.error;
73+
event = eventFromStacktrace(computeStackTrace(exception as Error));
7374
return event;
7475
}
75-
if (isDOMError(exception) || isDOMException(exception)) {
76-
// If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)
77-
// then we just extract the name, code, and message, as they don't provide anything else
78-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
79-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
76+
77+
// If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
78+
// and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
79+
// `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
80+
//
81+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
82+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
83+
// https://webidl.spec.whatwg.org/#es-DOMException-specialness
84+
if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {
8085
const domException = exception as DOMException;
81-
const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
82-
const message = domException.message ? `${name}: ${domException.message}` : name;
8386

84-
event = eventFromString(message, syntheticException, options);
85-
addExceptionTypeValue(event, message);
87+
if ('stack' in (exception as Error)) {
88+
event = eventFromStacktrace(computeStackTrace(exception as Error));
89+
} else {
90+
const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
91+
const message = domException.message ? `${name}: ${domException.message}` : name;
92+
event = eventFromString(message, syntheticException, options);
93+
addExceptionTypeValue(event, message);
94+
}
8695
if ('code' in domException) {
8796
event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };
8897
}
8998

9099
return event;
91100
}
92-
if (isError(exception)) {
101+
if (isError(exception as Error)) {
93102
// we have a real Error object, do nothing
94-
event = eventFromStacktrace(computeStackTrace(exception));
103+
event = eventFromStacktrace(computeStackTrace(exception as Error));
95104
return event;
96105
}
97106
if (isPlainObject(exception) || isEvent(exception)) {

packages/core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/core",
3-
"version": "6.14.1",
3+
"version": "6.15.0",
44
"description": "Base implementation for all Sentry JavaScript SDKs",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
@@ -16,10 +16,10 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/hub": "6.14.1",
20-
"@sentry/minimal": "6.14.1",
21-
"@sentry/types": "6.14.1",
22-
"@sentry/utils": "6.14.1",
19+
"@sentry/hub": "6.15.0",
20+
"@sentry/minimal": "6.15.0",
21+
"@sentry/types": "6.15.0",
22+
"@sentry/utils": "6.15.0",
2323
"tslib": "^1.9.3"
2424
},
2525
"devDependencies": {

packages/core/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SDK_VERSION = '6.14.1';
1+
export const SDK_VERSION = '6.15.0';

packages/ember/addon/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import { timestampWithMs } from '@sentry/utils';
88
import { GlobalConfig, OwnConfig } from './types';
99
import { getGlobalObject } from '@sentry/utils';
1010

11-
declare module '@ember/debug' {
12-
export function assert(desc: string, test: unknown): void;
13-
}
14-
1511
function _getSentryInitConfig() {
1612
const _global = getGlobalObject<GlobalConfig>();
1713
_global.__sentryEmberConfig = _global.__sentryEmberConfig ?? {};

0 commit comments

Comments
 (0)