Session stuck in 'starting' or 'stoped' state due to Node.js Buffer limit reached when loading large RemoteAuth database entries (PostgreSQL/WebJS) #2090
Lottie stickers arrive from WhatsApp as a ZIP archive (mimetype
application/was) containing animation/animation.json. This change
intercepts those stickers in the GOWS Plus session, renders each
animation frame off-screen, and delivers an animated WebP to the
webhook instead of the raw ZIP.
Implementation:
- src/plus/utils/lottie-converter.ts (new):
- Extracts animation.json from the ZIP via adm-zip
- Renders frames with @lottiefiles/dotlottie-web + @napi-rs/canvas
(HTMLCanvasElement polyfill required; ImageData must NOT be polyfilled
to avoid per-frame pixel caching in WASM memory)
- Drives frames manually via dotLottie.setFrame(i) after 'load' for
reliable synchronous capture
- Encodes each RGBA frame to single-frame WebP with sharp (quality=80)
- Assembles animated WebP via node-webpmux with full alpha transparency
- Frame delay derived from animation fps; clamped to >=30ms
- Fallback delay configurable via WAHA_LOTTIE_DEFAULT_DELAY_MS env var
- sharp/adm-zip/node-webpmux loaded via require() — their module.exports
is the callable itself with no .default, so ESM default import resolves
to undefined at runtime
- src/plus/engines/gows/session.gows.plus.ts:
- Overrides downloadMedia with LottieAwareGOWSEngineMediaProcessor
- normalizeStickerUrl: fixes GOWS URL field case mismatch (URL vs url)
that caused an infinite network loop on Lottie downloads
- Reports mimetype image/webp and extension .webp for Lottie stickers
- package.json: add @lottiefiles/dotlottie-web, @napi-rs/canvas,
node-webpmux to dependencies
Fix GET groups internal error
- fix#1860
Fix Send message to channel - fix#1863
Fix contact update - fix#1839
[WEBJS] - Get groups count and Get groups failed fix#1879fix#1873