-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Update Jimp and sharp dependencies for Baileys new version #1727
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
base: develop
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR resolves incompatibilities between Baileys and image libraries by upgrading Jimp and Sharp, updating Jimp method signatures in the Chatwoot service, and enabling synthetic default imports in TypeScript configuration. Class diagram for Buffer and Readable usage in image processingclassDiagram
class Buffer {
+from(data, encoding)
}
class Readable {
+_read()
}
ChatwootService --> Buffer : uses
ChatwootService --> Readable : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @minarkap - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:2106` </location>
<code_context>
+ img.cover({ w: 320, h: 180 });
- const processedBuffer = await img.getBufferAsync(Jimp.MIME_PNG);
+ const processedBuffer = await img.getBuffer(JimpMime.png);
const fileStream = new Readable();
</code_context>
<issue_to_address>
Switching from getBufferAsync to getBuffer may introduce callback-based async handling.
`getBuffer` uses a callback and cannot be awaited directly. Please ensure it is promisified or use an async alternative to prevent issues.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
||
const processedBuffer = await img.getBufferAsync(Jimp.MIME_PNG); | ||
const processedBuffer = await img.getBuffer(JimpMime.png); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Switching from getBufferAsync to getBuffer may introduce callback-based async handling.
getBuffer
uses a callback and cannot be awaited directly. Please ensure it is promisified or use an async alternative to prevent issues.
I have solved an incompatibility between sharp, jimp & Baileys, and had to change some methods in chatwoot ts
Summary by Sourcery
Upgrade image processing libraries and adjust code and TypeScript config to resolve incompatibilities between Jimp, Sharp, and Baileys
Enhancements:
Build: