File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed
Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change 88 ClientRequest ,
99 CreateMessageRequestSchema ,
1010 ListRootsRequestSchema ,
11- ProgressNotificationSchema ,
12- ResourceUpdatedNotificationSchema ,
13- LoggingMessageNotificationSchema ,
1411 Request ,
1512 Result ,
1613 ServerCapabilities ,
@@ -250,20 +247,12 @@ export function useConnection({
250247 } ) ;
251248
252249 if ( onNotification ) {
253- client . setNotificationHandler (
254- ProgressNotificationSchema ,
255- onNotification ,
256- ) ;
257-
258- client . setNotificationHandler (
259- ResourceUpdatedNotificationSchema ,
260- onNotification ,
261- ) ;
262-
263- client . setNotificationHandler (
264- LoggingMessageNotificationSchema ,
265- onNotification ,
266- ) ;
250+ client . fallbackNotificationHandler = (
251+ notification : Notification ,
252+ ) : Promise < void > => {
253+ onNotification ( notification ) ;
254+ return Promise . resolve ( ) ;
255+ } ;
267256 }
268257
269258 if ( onStdErrNotification ) {
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ export const StdErrNotificationSchema = BaseNotificationSchema.extend({
1414
1515export const NotificationSchema = ClientNotificationSchema . or (
1616 StdErrNotificationSchema ,
17- ) . or ( ServerNotificationSchema ) ;
17+ )
18+ . or ( ServerNotificationSchema )
19+ . or ( BaseNotificationSchema ) ;
1820
1921export type StdErrNotification = z . infer < typeof StdErrNotificationSchema > ;
2022export type Notification = z . infer < typeof NotificationSchema > ;
You can’t perform that action at this time.
0 commit comments