@queenanya/baileys 8.2.5-beta → 8.2.6-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,7 +112,6 @@ const makeMessagesSocket = (config) => {
112
112
  };
113
113
  /** Fetch all the devices we've to send a message to */
114
114
  const getUSyncDevices = async (jids, useCache, ignoreZeroDevices) => {
115
- var _a;
116
115
  const deviceResults = [];
117
116
  if (!useCache) {
118
117
  logger.debug('not using cache for devices');
@@ -120,7 +119,12 @@ const makeMessagesSocket = (config) => {
120
119
  const toFetch = [];
121
120
  jids = Array.from(new Set(jids));
122
121
  for (let jid of jids) {
123
- const user = (_a = (0, WABinary_1.jidDecode)(jid)) === null || _a === void 0 ? void 0 : _a.user;
122
+ const decoded = (0, WABinary_1.jidDecode)(jid);
123
+ if (!decoded || !decoded.user) {
124
+ logger.warn(`Failed to decode or extract user from JID: ${jid}`);
125
+ continue; // skip if invalid
126
+ }
127
+ const user = decoded.user;
124
128
  jid = (0, WABinary_1.jidNormalizedUser)(jid);
125
129
  if (useCache) {
126
130
  const devices = userDevicesCache.get(user);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@queenanya/baileys",
3
- "version": "8.2.5-beta",
3
+ "version": "8.2.6-beta",
4
4
  "description": "Custom Baileys WhatsApp API",
5
5
  "keywords": [
6
6
  "baileys",