socket-function 0.108.0 → 0.110.0
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.
- package/package.json +1 -1
- package/src/callManager.ts +2 -2
- package/src/nodeCache.ts +6 -0
package/package.json
CHANGED
package/src/callManager.ts
CHANGED
|
@@ -38,13 +38,13 @@ export async function performLocalCall(
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (!exposedClasses.has(call.classGuid)) {
|
|
41
|
-
throw new Error(`Class ${call.classGuid} not exposed
|
|
41
|
+
throw new Error(`Class ${call.classGuid} not exposed. Call SocketFunction.expose (serverside) with this class. Exposed classes: ${Array.from(exposedClasses).join(", ")}`);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
let controller = classDef.controller;
|
|
45
45
|
let functionShape = classDef.shape[call.functionName];
|
|
46
46
|
if (!functionShape) {
|
|
47
|
-
throw new Error(`Function ${call.functionName} not exposed in ${call.classGuid}
|
|
47
|
+
throw new Error(`Function ${call.functionName} not exposed in ${call.classGuid}. Add it to the 3rd argument of SocketFunction.expose.`);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (!controller[call.functionName]) {
|
package/src/nodeCache.ts
CHANGED
|
@@ -87,6 +87,12 @@ export function getCallFactory(nodeId: string): MaybePromise<CallFactory | undef
|
|
|
87
87
|
return nodeCache.get(nodeId);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
export function resetAllNodeCallFactories() {
|
|
91
|
+
// Needs to be done if you want to reset authentication. Outstanding calls still work,
|
|
92
|
+
// but new calls use new factories (and connections).
|
|
93
|
+
nodeCache.clear();
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
const startCleanupLoop = lazy(() => {
|
|
91
97
|
(async () => {
|
|
92
98
|
while (true) {
|