@clawchatsai/connector 0.0.19 → 0.0.20
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/dist/index.d.ts +1 -1
- package/dist/index.js +10 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Spec: specs/multitenant-p2p.md sections 6.1-6.2
|
|
11
11
|
*/
|
|
12
12
|
export declare const PLUGIN_ID = "connector";
|
|
13
|
-
export declare const PLUGIN_VERSION = "0.0.
|
|
13
|
+
export declare const PLUGIN_VERSION = "0.0.20";
|
|
14
14
|
interface PluginServiceContext {
|
|
15
15
|
stateDir: string;
|
|
16
16
|
logger: {
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import { generateSessionSecret } from './session-token.js';
|
|
|
22
22
|
// Inline from shared/api-version.ts to avoid rootDir conflict
|
|
23
23
|
const CURRENT_API_VERSION = 1;
|
|
24
24
|
export const PLUGIN_ID = 'connector';
|
|
25
|
-
export const PLUGIN_VERSION = '0.0.
|
|
25
|
+
export const PLUGIN_VERSION = '0.0.20';
|
|
26
26
|
/** Max DataChannel message size (~256KB, leave room for envelope) */
|
|
27
27
|
const MAX_DC_MESSAGE_SIZE = 256 * 1024;
|
|
28
28
|
/** Active DataChannel connections: connectionId → send function */
|
|
@@ -327,7 +327,15 @@ function setupDataChannelHandler(dc, connectionId, ctx) {
|
|
|
327
327
|
// Pre-auth non-auth message — drop silently
|
|
328
328
|
return;
|
|
329
329
|
case 'pass':
|
|
330
|
-
// Already authenticated —
|
|
330
|
+
// Already authenticated — but verify this connection is actually
|
|
331
|
+
// in connectedClients. If auth_timeout deleted the session but the
|
|
332
|
+
// DC is still open, we'd get 'pass' for an un-authed connection.
|
|
333
|
+
// Re-initiate auth instead of processing the message.
|
|
334
|
+
if (!connectedClients.has(connectionId)) {
|
|
335
|
+
ctx.logger.warn(`Stale connection ${connectionId} — re-initiating auth`);
|
|
336
|
+
initAuth(dc, connectionId);
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
331
339
|
break;
|
|
332
340
|
}
|
|
333
341
|
// Authenticated message processing
|