Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AArnott opened this issue May 2, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@AArnott
Copy link
Member

AArnott commented May 2, 2023

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.

@AArnott AArnott added the enhancement New feature or request label May 2, 2023
@AArnott AArnott self-assigned this May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant