File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
gitpod-protocol/src/messaging Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,9 @@ export class JsonRpcProxyFactory<T extends object> implements ProxyHandler<T> {
95
95
*
96
96
* @param target - The object to expose to JSON-RPC methods calls. If this
97
97
* is omitted, the proxy won't be able to handle requests, only send them.
98
+ * @param propagateConnectionEvents - If true, the MessageConnection open/close are mapped to proxy open/close
98
99
*/
99
- constructor ( public target ?: any ) {
100
+ constructor ( public target ?: any , protected propagateConnectionEvents : boolean = false ) {
100
101
this . waitForConnection ( ) ;
101
102
}
102
103
@@ -105,7 +106,9 @@ export class JsonRpcProxyFactory<T extends object> implements ProxyHandler<T> {
105
106
this . connectionPromiseResolve = resolve
106
107
) ;
107
108
this . connectionPromise . then ( connection => {
108
- connection . onClose ( ( ) => this . fireConnectionClosed ( ) ) ;
109
+ if ( this . propagateConnectionEvents ) {
110
+ connection . onClose ( ( ) => this . fireConnectionClosed ( ) ) ;
111
+ }
109
112
this . fireConnectionOpened ( ) ;
110
113
} ) ;
111
114
}
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ class GitpodJsonRpcProxyFactory<T extends object> extends JsonRpcProxyFactory<T>
169
169
protected readonly accessGuard : FunctionAccessGuard ,
170
170
protected readonly rateLimiter : RateLimiter ,
171
171
) {
172
- super ( ) ;
172
+ super ( undefined , true ) ;
173
173
}
174
174
175
175
protected async onRequest ( method : string , ...args : any [ ] ) : Promise < any > {
You can’t perform that action at this time.
0 commit comments