Skip to content

Commit 3e7ac9a

Browse files
authored
ref(core): Remove unused special handling for Debug integration (#15299)
This integration is removed in v9 so we do not need this code anymore. Noticed this by chance 😅
1 parent b720e15 commit 3e7ac9a

File tree

2 files changed

+1
-59
lines changed

2 files changed

+1
-59
lines changed

packages/core/src/integration.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,7 @@ export function getIntegrationsToSetup(options: Pick<Options, 'defaultIntegratio
6060
integrations = defaultIntegrations;
6161
}
6262

63-
const finalIntegrations = filterDuplicates(integrations);
64-
65-
// The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or
66-
// `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event
67-
// processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore
68-
// locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.
69-
const debugIndex = finalIntegrations.findIndex(integration => integration.name === 'Debug');
70-
if (debugIndex > -1) {
71-
const [debugInstance] = finalIntegrations.splice(debugIndex, 1) as [Integration];
72-
finalIntegrations.push(debugInstance);
73-
}
74-
75-
return finalIntegrations;
63+
return filterDuplicates(integrations);
7664
}
7765

7866
/**

packages/core/test/lib/integration.test.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -189,29 +189,6 @@ describe('getIntegrationsToSetup', () => {
189189
});
190190
});
191191

192-
describe('puts `Debug` integration last', () => {
193-
// No variations here (default vs user, duplicates, user array vs user function, etc) because by the time we're
194-
// dealing with the `Debug` integration, all of the combining and deduping has already been done
195-
const noDebug = [new MockIntegration('ChaseSquirrels')];
196-
const debugNotLast = [new MockIntegration('Debug'), new MockIntegration('CatchTreats')];
197-
const debugAlreadyLast = [new MockIntegration('ChaseSquirrels'), new MockIntegration('Debug')];
198-
199-
const testCases: TestCase[] = [
200-
// each test case is [testName, defaultIntegrations, userIntegrations, expectedResult]
201-
['`Debug` not present', false, noDebug, ['ChaseSquirrels']],
202-
['`Debug` not originally last', false, debugNotLast, ['CatchTreats', 'Debug']],
203-
['`Debug` already last', false, debugAlreadyLast, ['ChaseSquirrels', 'Debug']],
204-
];
205-
206-
test.each(testCases)('%s', (_, defaultIntegrations, userIntegrations, expected) => {
207-
const integrations = getIntegrationsToSetup({
208-
defaultIntegrations,
209-
integrations: userIntegrations,
210-
});
211-
expect(integrations.map(i => i.name)).toEqual(expected);
212-
});
213-
});
214-
215192
it('works with empty array', () => {
216193
const integrations = getIntegrationsToSetup({
217194
integrations: [],
@@ -305,29 +282,6 @@ describe('getIntegrationsToSetup', () => {
305282
expect((integrations[0] as any).order).toEqual('firstUser');
306283
expect((integrations[1] as any).order).toEqual('secondUser');
307284
});
308-
309-
it('always moves Debug integration to the end of the list', () => {
310-
let integrations = getIntegrationsToSetup({
311-
defaultIntegrations: [new MockIntegration('Debug'), new MockIntegration('foo')],
312-
integrations: [new MockIntegration('bar')],
313-
});
314-
315-
expect(integrations.map(i => i.name)).toEqual(['foo', 'bar', 'Debug']);
316-
317-
integrations = getIntegrationsToSetup({
318-
defaultIntegrations: [new MockIntegration('foo')],
319-
integrations: [new MockIntegration('Debug'), new MockIntegration('bar')],
320-
});
321-
322-
expect(integrations.map(i => i.name)).toEqual(['foo', 'bar', 'Debug']);
323-
324-
integrations = getIntegrationsToSetup({
325-
defaultIntegrations: [new MockIntegration('Debug')],
326-
integrations: [new MockIntegration('foo')],
327-
});
328-
329-
expect(integrations.map(i => i.name)).toEqual(['foo', 'Debug']);
330-
});
331285
});
332286

333287
describe('setupIntegration', () => {

0 commit comments

Comments
 (0)