[PR #55] [MERGED] fix(socket): correct event listener callback handling #64

Closed
opened 2026-02-27 10:25:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mimamch/wa-multi-session/pull/55
Author: @Mazen-Almortada
Created: 8/20/2025
Status: Merged
Merged: 8/20/2025
Merged by: @mimamch

Base: masterHead: master


📝 Commits (1)

  • 365f5a7 fix(socket): correct event listener callback handling

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 src/Socket/index.ts (+3 -3)

📄 Description

This commit resolves two bugs related to event listener callbacks in the socket handler:

  • onPairingCode listener Was incorrectly using the ON_MESSAGE_UPDATED key, which caused it to overwrite the onMessageUpdate listener.

  • onMessageUpdate listener Was being called with two arguments (sessionId, data) instead of the single expected data object, causing a TypeError for consumers.

Both issues have been corrected to ensure event listeners work as intended.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mimamch/wa-multi-session/pull/55 **Author:** [@Mazen-Almortada](https://github.com/Mazen-Almortada) **Created:** 8/20/2025 **Status:** ✅ Merged **Merged:** 8/20/2025 **Merged by:** [@mimamch](https://github.com/mimamch) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`365f5a7`](https://github.com/mimamch/wa-multi-session/commit/365f5a7c9e5718f61747daed1bf2af121cf4110b) fix(socket): correct event listener callback handling ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/Socket/index.ts` (+3 -3) </details> ### 📄 Description This commit resolves two bugs related to event listener callbacks in the socket handler: - **`onPairingCode` listener** Was incorrectly using the `ON_MESSAGE_UPDATED` key, which caused it to overwrite the `onMessageUpdate` listener. - **`onMessageUpdate` listener** Was being called with two arguments (`sessionId, data`) instead of the single expected `data` object, causing a `TypeError` for consumers. Both issues have been corrected to ensure event listeners work as intended. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:25:46 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wa-multi-session-mimamch#64
No description provided.