server: possibly fix bug where rpc object may not be found

This commit is contained in:
Koushik Dutta
2024-09-04 10:36:56 -07:00
parent 1e1755fa7e
commit 5f4e2793ff
5 changed files with 50 additions and 19 deletions

View File

@@ -268,12 +268,21 @@ class RpcPeer:
proxiedEntry = self.localProxied.get(value, None)
if proxiedEntry:
if self.onProxySerialization:
proxyId, __remote_proxy_props = self.onProxySerialization(value)
else:
__remote_proxy_props = RpcPeer.prepareProxyProperties(value)
proxyId = proxiedEntry['id']
if proxyId != proxiedEntry['id']:
raise Exception('onProxySerialization proxy id mismatch')
proxiedEntry['finalizerId'] = RpcPeer.generateId()
ret = {
'__remote_proxy_id': proxiedEntry['id'],
'__remote_proxy_id': proxyId,
'__remote_proxy_finalizer_id': proxiedEntry['finalizerId'],
'__remote_constructor_name': __remote_constructor_name,
'__remote_proxy_props': RpcPeer.prepareProxyProperties(value),
'__remote_proxy_props': __remote_proxy_props,
'__remote_proxy_oneway_methods': getattr(value, '__proxy_oneway_methods', None),
}
return ret