Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No events fired after successful QR code scan #2991

Closed
1 task done
prakashgp opened this issue Apr 25, 2024 · 1 comment
Closed
1 task done

No events fired after successful QR code scan #2991

prakashgp opened this issue Apr 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@prakashgp
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The code was working fine for a quite long time, then suddenly stopped working recently.

Only qr event is getting fired. None of the other events are fired

    client.on('ready', async () => {
        console.log('Ready')
    })

    client.on('authenticated', () => {
        console.log('authenticated')
    })
    client.on('auth_failure', msg => {
        console.error('wa authentication failure', msg)
    });
        
    client.on('change_state', (state) => {
        console.log('wa change state', state)
    });
    
    client.on('disconnected', (reason) => {
        console.log('wa disconnected', reason)

    });

Expected behavior

After scanning QR code and successfully loading chat messages, it should fire ready event which isn't happening

Steps to Reproduce the Bug or Issue

Scan QR code

Relevant Code


let {Client} = wwebjs
const client = new Client({puppeteer: {headless: false}, authStrategy: new LocalAuth()})

client.on('qr', async (qr) => {
    qrCodeData = await QRCode.toDataURL(qr, {
        width: 300
    })
    let qrCode = await QRCode.toString(qr, {type: 'terminal', small: true})
    console.log(qrCode)
    log.info(`
        You are not authorized with whatsapp. 
        Scan the QR code above to authenticate the actor with whatsapp.
    `)
})

client.on('ready', async () => {
    console.log('Authentication successful')
})

client.on('authenticated', error => {
    console.log(error)
})
client.on('auth_failure', msg => {
    console.error('wa authentication failure', msg)
});
    
client.on('change_state', (state) => {
    console.log('wa change state', state)
});

client.on('disconnected', (reason) => {
    console.log('wa disconnected', reason)
    client.initialize()
})

client.initialize()

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Mac, Linux
Node version: v20.12.1
wwebjs version: 1.22.1

Additional context

No response

@prakashgp prakashgp added the bug Something isn't working label Apr 25, 2024
@alechkos
Copy link
Collaborator

Use this or #2816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants