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

converting stream to buffer when uploading files without apparent need #922

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

erickythierry
Copy link
Contributor

the conversion is only being carried out to check the file size and compare it with the maximum size limit of the upload hosts. However, these hosts are returning null in the maxContentLengthBytes field, because of this, the code becomes useless and generates a problem of intense RAM usage without need in cases of sending large files.

I modified it to remove the size check (since it will never be checked since the value is null)
and I passed the stream directly to the axios request, so the file will be sent in stream mode, saving RAM

@whiskeysockets-bot
Copy link
Contributor

Thanks for your contribution.

The next step is to wait for review and approval to merge it to main repository

The community can help reacting with a thumb up (:thumbsup:) for approval and rocket (:rocket:) for who has tested it.

To test this PR you can run the following command below:

# NPM
npm install @whiskeysockets/baileys@erickythierry/Baileys#master
# YARN v2
yarn add @whiskeysockets/baileys@erickythierry/Baileys#master

Copy link
Contributor

@azudindaem azudindaem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@PurpShell PurpShell merged commit 07742e6 into WhiskeySockets:master Jul 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants