@volley/recognition-client-sdk 0.1.254 → 0.1.255

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volley/recognition-client-sdk",
3
- "version": "0.1.254",
3
+ "version": "0.1.255",
4
4
  "description": "Recognition Service TypeScript/Node.js Client SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -53,10 +53,10 @@
53
53
  "ts-jest": "^29.4.5",
54
54
  "tsup": "^8.5.0",
55
55
  "typescript": "^5.1.6",
56
- "@recog/shared-types": "1.0.0",
57
56
  "@recog/shared-config": "1.0.0",
58
57
  "@recog/websocket": "1.0.0",
59
- "@recog/shared-utils": "1.0.0"
58
+ "@recog/shared-utils": "1.0.0",
59
+ "@recog/shared-types": "1.0.0"
60
60
  },
61
61
  "keywords": [
62
62
  "recognition",
@@ -336,8 +336,11 @@ export class RealTimeTwoWayWebSocketRecognitionClient
336
336
  let lastError: Error | undefined;
337
337
 
338
338
  // Store original handlers once (not per-attempt to avoid nested wrappers)
339
- const originalOnConnected = this.config.onConnected;
340
- const originalOnError = this.config.onError;
339
+ // IMPORTANT: Save the bound protected methods (they contain the real logic)!
340
+ // The protected onConnected() method sends ASRRequest and then calls config callback
341
+ // The protected onError() method converts Event to ErrorResultV1 and calls config callback
342
+ const originalOnConnected = this.onConnected.bind(this);
343
+ const originalOnError = this.onError.bind(this);
341
344
 
342
345
  try {
343
346
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
@@ -441,10 +444,10 @@ export class RealTimeTwoWayWebSocketRecognitionClient
441
444
  lastError
442
445
  );
443
446
  } finally {
444
- // Restore original handlers
445
- this.config.onConnected = originalOnConnected;
446
- this.config.onError = originalOnError;
447
-
447
+ // Restore original protected method handlers
448
+ this.onConnected = originalOnConnected;
449
+ this.onError = originalOnError;
450
+
448
451
  // Clear connectionPromise only after entire retry sequence completes (success or failure)
449
452
  this.connectionPromise = undefined;
450
453
  }