Skip to content

Commit d371316

Browse files
authored
Merge branch 'develop' into aliu/launch-darkly-integration
2 parents 948cea7 + 0aa7f1d commit d371316

File tree

57 files changed

+1169
-157
lines changed

Some content is hidden

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

57 files changed

+1169
-157
lines changed

.github/workflows/external-contributors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
# This token is scoped to Daniel Griesser
4242
# If we used the default GITHUB_TOKEN, the resulting PR would not trigger CI :(
4343
token: ${{ secrets.REPO_SCOPED_TOKEN }}
44-
commit-message: "ref: Add external contributor to CHANGELOG.md"
45-
title: "ref: Add external contributor to CHANGELOG.md"
44+
commit-message: "chore: Add external contributor to CHANGELOG.md"
45+
title: "chore: Add external contributor to CHANGELOG.md"
4646
branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}'
4747
base: 'develop'
4848
delete-branch: true

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

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

13+
Work in this release was contributed by @Zen-cronic. Thank you for your contribution!
14+
15+
Work in this release was contributed by @grahamhency, @Zen-cronic, @gilisho and @phuctm97. Thank you for your contributions!
16+
1317
## 8.37.1
1418

1519
- feat(deps): Bump @opentelemetry/instrumentation from 0.53.0 to 0.54.0 for @sentry/opentelemetry ([#14187](https://github.com/getsentry/sentry-javascript/pull/14187))
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
Sentry.init({
4+
dsn: 'https://[email protected]/1337',
5+
integrations: [],
6+
});
7+
8+
window.Sentry = {
9+
...Sentry,
10+
// Ensure this is _not_ set
11+
moduleMetadataIntegration: undefined,
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
window._testLazyLoadIntegration = async function run() {
2+
const integration = await window.Sentry.lazyLoadIntegration('moduleMetadataIntegration');
3+
4+
window.Sentry.getClient()?.addIntegration(integration());
5+
6+
window._integrationLoaded = true;
7+
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { expect } from '@playwright/test';
2+
import { SDK_VERSION } from '@sentry/browser';
3+
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
6+
sentryTest('it allows to lazy load the moduleMetadata integration', async ({ getLocalTestUrl, page }) => {
7+
const url = await getLocalTestUrl({ testDir: __dirname });
8+
9+
await page.route(`https://browser.sentry-cdn.com/${SDK_VERSION}/modulemetadata.min.js`, route => {
10+
return route.fulfill({
11+
status: 200,
12+
contentType: 'application/javascript;',
13+
body: "window.Sentry.moduleMetadataIntegration = () => ({ name: 'ModuleMetadata' })",
14+
});
15+
});
16+
17+
await page.goto(url);
18+
19+
const hasIntegration = await page.evaluate('!!window.Sentry.getClient()?.getIntegrationByName("ModuleMetadata")');
20+
expect(hasIntegration).toBe(false);
21+
22+
const scriptTagsBefore = await page.evaluate<number>('document.querySelectorAll("script").length');
23+
24+
await page.evaluate('window._testLazyLoadIntegration()');
25+
await page.waitForFunction('window._integrationLoaded');
26+
27+
const scriptTagsAfter = await page.evaluate<number>('document.querySelectorAll("script").length');
28+
29+
const hasIntegration2 = await page.evaluate('!!window.Sentry.getClient()?.getIntegrationByName("ModuleMetadata")');
30+
expect(hasIntegration2).toBe(true);
31+
32+
expect(scriptTagsAfter).toBe(scriptTagsBefore + 1);
33+
});

dev-packages/browser-integration-tests/utils/generatePlugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const IMPORTED_INTEGRATION_CDN_BUNDLE_PATHS: Record<string, string> = {
3737
reportingObserverIntegration: 'reportingobserver',
3838
sessionTimingIntegration: 'sessiontiming',
3939
feedbackIntegration: 'feedback',
40+
moduleMetadataIntegration: 'modulemetadata',
4041
};
4142

4243
const BUNDLE_PATHS: Record<string, Record<string, string>> = {

dev-packages/e2e-tests/test-applications/nextjs-t3/tests/trpc-error.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ test('should capture error with trpc context', async ({ page }) => {
1212
const trpcError = await errorEventPromise;
1313

1414
expect(trpcError).toBeDefined();
15-
expect(trpcError.contexts.trpc).toBeDefined();
16-
expect(trpcError.contexts.trpc.procedure_type).toEqual('mutation');
17-
expect(trpcError.contexts.trpc.input).toEqual({ name: 'I love dogs' });
15+
expect(trpcError.contexts?.trpc).toBeDefined();
16+
expect(trpcError.contexts?.trpc?.procedure_type).toEqual('mutation');
17+
expect(trpcError.contexts?.trpc?.procedure_path).toBe('post.throwError');
18+
expect(trpcError.contexts?.trpc?.input).toEqual({ name: 'I love dogs' });
1819
});
1920

2021
test('should create transaction with trpc input for error', async ({ page }) => {
@@ -26,9 +27,5 @@ test('should create transaction with trpc input for error', async ({ page }) =>
2627
await page.click('#error-button');
2728

2829
const trpcTransaction = await trpcTransactionPromise;
29-
3030
expect(trpcTransaction).toBeDefined();
31-
expect(trpcTransaction.contexts.trpc).toBeDefined();
32-
expect(trpcTransaction.contexts.trpc.procedure_type).toEqual('mutation');
33-
expect(trpcTransaction.contexts.trpc.input).toEqual({ name: 'I love dogs' });
3431
});

dev-packages/e2e-tests/test-applications/nextjs-t3/tests/trpc-mutation.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ test('should create transaction with trpc input for mutation', async ({ page })
1313
const trpcTransaction = await trpcTransactionPromise;
1414

1515
expect(trpcTransaction).toBeDefined();
16-
expect(trpcTransaction.contexts.trpc).toBeDefined();
17-
expect(trpcTransaction.contexts.trpc.procedure_type).toEqual('mutation');
18-
expect(trpcTransaction.contexts.trpc.input).toEqual({ name: 'I love dogs' });
1916
});

dev-packages/e2e-tests/test-applications/node-express/tests/trpc.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ test('Should record span for trpc query', async ({ baseURL }) => {
3333
description: `trpc/getSomething`,
3434
}),
3535
);
36-
37-
expect(transaction.contexts?.trpc).toMatchObject({
38-
procedure_type: 'query',
39-
input: 'foobar',
40-
});
4136
});
4237

4338
test('Should record transaction for trpc mutation', async ({ baseURL }) => {
@@ -70,10 +65,6 @@ test('Should record transaction for trpc mutation', async ({ baseURL }) => {
7065
description: `trpc/createSomething`,
7166
}),
7267
);
73-
74-
expect(transaction.contexts?.trpc).toMatchObject({
75-
procedure_type: 'mutation',
76-
});
7768
});
7869

7970
test('Should record transaction and error for a crashing trpc handler', async ({ baseURL }) => {
@@ -100,6 +91,9 @@ test('Should record transaction and error for a crashing trpc handler', async ({
10091

10192
await expect(transactionEventPromise).resolves.toBeDefined();
10293
await expect(errorEventPromise).resolves.toBeDefined();
94+
95+
expect((await errorEventPromise).contexts?.trpc?.['procedure_type']).toBe('mutation');
96+
expect((await errorEventPromise).contexts?.trpc?.['procedure_path']).toBe('crashSomething');
10397
});
10498

10599
test('Should record transaction and error for a trpc handler that returns a status code', async ({ baseURL }) => {

dev-packages/node-integration-tests/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"graphql": "^16.3.0",
5151
"http-terminator": "^3.2.0",
5252
"ioredis": "^5.4.1",
53+
"knex": "^2.5.1",
5354
"kafkajs": "2.2.4",
5455
"lru-memoizer": "2.3.0",
5556
"mongodb": "^3.7.3",

0 commit comments

Comments
 (0)