kage-baileys 25.4.6 → 25.4.7
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/lib/Socket/socket.js
CHANGED
|
@@ -714,7 +714,7 @@ export const makeSocket = (config) => {
|
|
|
714
714
|
}
|
|
715
715
|
authState.creds.pairingCodeRef = pairingRef;
|
|
716
716
|
ev.emit('creds.update', authState.creds);
|
|
717
|
-
logger.info({ phoneNumber: normalizedNumber, refLength: pairingRef.length
|
|
717
|
+
logger.info({ phoneNumber: normalizedNumber, refLength: pairingRef.length }, 'pairing code registered with WhatsApp');
|
|
718
718
|
return authState.creds.pairingCode;
|
|
719
719
|
}
|
|
720
720
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kage-baileys",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "25.4.
|
|
5
|
-
"description": "Kage Baileys with validated WhatsApp pairing-code flow, Native Flow review_and_pay relay fixes, expanded WAProto schema and guarded media diagnostics",
|
|
4
|
+
"version": "25.4.7",
|
|
5
|
+
"description": "Kage Baileys with pairing logger ReferenceError fix, validated WhatsApp pairing-code flow, Native Flow review_and_pay relay fixes, expanded WAProto schema and guarded media diagnostics",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"whatsapp",
|
|
8
8
|
"automation"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"THIRD_PARTY_NOTICES.md",
|
|
33
33
|
"PAIRING-CODE-FIX-REPORT.md",
|
|
34
34
|
"INTEGRATION-REPORT.md",
|
|
35
|
-
"TEST-REPORT-25.4.
|
|
35
|
+
"TEST-REPORT-25.4.6.txt"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build:all": "npm run check",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import test from 'node:test'
|
|
2
|
+
import assert from 'node:assert/strict'
|
|
3
|
+
import { readFile } from 'node:fs/promises'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
import { dirname, resolve } from 'node:path'
|
|
6
|
+
|
|
7
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
const socketSource = await readFile(resolve(here, '../lib/Socket/socket.js'), 'utf8')
|
|
9
|
+
|
|
10
|
+
test('pairing success logger does not reference an undefined registration variable', () => {
|
|
11
|
+
assert.match(socketSource, /pairing code registered with WhatsApp/)
|
|
12
|
+
assert.doesNotMatch(socketSource, /registration\?\.attrs\?\.stage/)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
test('pairing reference is extracted before success is logged and code is returned', () => {
|
|
16
|
+
const extractAt = socketSource.indexOf('const pairingRef = extractPairingReference(response)')
|
|
17
|
+
const logAt = socketSource.indexOf('pairing code registered with WhatsApp')
|
|
18
|
+
const returnAt = socketSource.indexOf('return authState.creds.pairingCode', logAt)
|
|
19
|
+
assert.ok(extractAt >= 0 && logAt > extractAt && returnAt > logAt)
|
|
20
|
+
})
|