Skip to content

Commit 08c39f1

Browse files
committed
remove unused import and comment legacy support
1 parent 62ca0f3 commit 08c39f1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

packages/core/src/mcp-server.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import type { Span } from './types-hoist/span';
21
import type {
32
ExtraHandlerData,
43
MCPServerInstance,
54
MCPTransport,
6-
SessionId,
75
} from './utils/mcp-server/types';
86
import {
97
createMcpNotificationSpan,
@@ -92,9 +90,10 @@ export function wrapMcpServerWithSentry<S extends object>(mcpServerInstance: S):
9290
const originalOnClose = transport.onclose;
9391
transport.onclose = new Proxy(originalOnClose, {
9492
apply(onCloseTarget, onCloseThisArg, onCloseArgs) {
95-
if (transport.sessionId) {
96-
handleTransportOnClose(transport.sessionId);
97-
}
93+
//TODO(bete): session and request correlation (methods at the bottom of this file)
94+
// if (transport.sessionId) {
95+
// handleTransportOnClose(transport.sessionId);
96+
// }
9897
return Reflect.apply(onCloseTarget, onCloseThisArg, onCloseArgs);
9998
},
10099
});
@@ -111,11 +110,11 @@ export function wrapMcpServerWithSentry<S extends object>(mcpServerInstance: S):
111110
// SESSION AND REQUEST CORRELATION (Legacy support)
112111
// =============================================================================
113112

114-
const sessionAndRequestToRequestParentSpanMap = new Map<SessionId, Map<string, Span>>();
113+
// const sessionAndRequestToRequestParentSpanMap = new Map<SessionId, Map<string, Span>>();
115114

116-
function handleTransportOnClose(sessionId: SessionId): void {
117-
sessionAndRequestToRequestParentSpanMap.delete(sessionId);
118-
}
115+
// function handleTransportOnClose(sessionId: SessionId): void {
116+
// sessionAndRequestToRequestParentSpanMap.delete(sessionId);
117+
// }
119118

120119
// TODO(bete): refactor this and associateContextWithRequestSpan to use the new span API.
121120
// function handleTransportOnMessage(sessionId: SessionId, requestId: string): void {

0 commit comments

Comments
 (0)