Skip to content

Missing support for *receiving* RPC marshaled objects with optional interfaces #84

@AArnott

Description

@AArnott

Outbound RPC marshalable objects have a chance to declare their optional interfaces by way of this interface:

export interface RpcMarshalable {
readonly _jsonRpcMarshalableLifetime: MarshaledObjectLifetime
readonly _jsonRpcOptionalInterfaces?: number[]
}

But inbound RPC marshaled objects only generally satisfy this interface:

export interface MarshaledObjectProxy extends IDisposable {
_jsonrpcMarshaledHandle: number
}
export module MarshaledObjectProxy {
export function is(value: any): value is MarshaledObjectProxy {
const valueCandidate = value as MarshaledObjectProxy | undefined
return typeof valueCandidate?._jsonrpcMarshaledHandle === 'number'
}
}
interface MarshaledObjectProxyTarget extends MarshaledObjectProxy {
messageConnection: MessageConnection
}

Note the lack of the _jsonRpcOptionalInterfaces property. This property becomes important for the receiver when the original object may support specific interfaces.

We should expose this property on the proxy target.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions