@scrypted/server 0.7.68 → 0.7.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @scrypted/server might be problematic. Click here for more details.
package/package.json
CHANGED
@@ -109,6 +109,13 @@ export function startPluginRemote(mainFilename: string, pluginId: string, peerSe
|
|
109
109
|
if (clusterObject?.id !== clusterId)
|
110
110
|
return value;
|
111
111
|
const { port, proxyId } = clusterObject;
|
112
|
+
if (port === clusterPort) {
|
113
|
+
// this is a local object.
|
114
|
+
const newValue = peer.localProxyMap.get(proxyId);
|
115
|
+
if (!newValue)
|
116
|
+
throw new Error('ipc object not found?');
|
117
|
+
return newValue;
|
118
|
+
}
|
112
119
|
|
113
120
|
let clusterPeerPromise = clusterPeers.get(port);
|
114
121
|
if (!clusterPeerPromise) {
|
@@ -136,6 +143,12 @@ export function startPluginRemote(mainFilename: string, pluginId: string, peerSe
|
|
136
143
|
const newValue = await connectRPCObject(proxyId, portSecret);
|
137
144
|
if (!newValue)
|
138
145
|
throw new Error('ipc object not found?');
|
146
|
+
// reassign the cluster identity in case this object gets passed back into the cluster.
|
147
|
+
newValue.__cluster = {
|
148
|
+
id: clusterId,
|
149
|
+
port,
|
150
|
+
proxyId,
|
151
|
+
};
|
139
152
|
return newValue;
|
140
153
|
}
|
141
154
|
catch (e) {
|