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

Unable to Download or Access View Once Messages using whatsapp-web.js #3349

Closed
2 tasks done
zorrodoasfalto opened this issue Oct 24, 2024 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@zorrodoasfalto
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this a problem caused by your code, or is it specifically because of the library?

  • I have double-checked my code carefully.

Describe the bug.

I am facing an issue where messages marked as 'view once' are not being properly downloaded or accessed using the latest version of whatsapp-web.js. Despite implementing the downloadMedia() method on received messages, the media data for view once messages consistently returns null. This problem persists even though other types of media are downloaded successfully.

I have already confirmed that my version of whatsapp-web.js is up-to-date. Is there a limitation or specific configuration needed to handle these messages? Any guidance or updates regarding this issue would be appreciated

Expected Behavior

I expected that when receiving a 'view once' message, the downloadMedia() method would correctly download the media content without returning null. The media should be accessible for further processing as it works with other media types.

Steps to Reproduce the Bug or Issue

Steps to Reproduce the Bug or Issue:
Set up the whatsapp-web.js client using the latest version.
Listen for incoming messages with the message event.
Check if the message is a "view once" message using the msg.isViewOnce property.
Attempt to download the media using the msg.downloadMedia() method.
Observe that the downloadMedia() method returns null when trying to access media from a "view once" message.

`if (msg.isViewOnce) {
console.log('View Once message received.');

            // Attempt to download the media
            const media = await msg.downloadMedia();

            if (media) {
                console.log('Media downloaded successfully:', media);
            } else {
                console.log('Failed to download media. Media is null.');
            }
        }`

WhatsApp Account Type

Standard

Browser Type

Google Chrome

Operation System Type

Windows 11

Phone OS Type

Android

WhatsApp-Web.js Version

1.26.1-alpha.2

WhatsApp Web Version

2.3000.1017640441

Node.js Version

20.16.0

Authentication Strategy

LocalAuth

Additional Context

No response

@zorrodoasfalto zorrodoasfalto added the bug Something isn't working label Oct 24, 2024
@alechkos
Copy link
Collaborator

alechkos commented Oct 24, 2024

@zorrodoasfalto
image

You have not searched for existing issues.
Fixed here.

@alechkos alechkos marked this as a duplicate of #3275 Oct 24, 2024
@alechkos alechkos closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
Repository owner locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants