Closed SamPandey001 closed 1 year ago
try with npm i @whiskeysockets/baileys@6.1.0
try with
npm i @whiskeysockets/baileys@6.1.0
huh,still same.
yes, i also got this problem when migrating my previous baileys, adiwajshing to this baileys.
this is my function when receive message.upsert :
sock.ev.on('messages.upsert', async chatUpdate => {
console.log('p')
console.log(JSON.stringify(chatUpdate, undefined, 2))
try {
mek = chatUpdate.messages[0]
if (!mek.message) return
mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message
if (mek.key && mek.key.remoteJid === 'status@broadcast') return
if (!sock.public && !mek.key.fromMe && chatUpdate.type === 'notify') return
if (mek.key.id.startsWith('BAE5') && mek.key.id.length === 16) return
m = smsg(sock, mek, store)
require("./hisoka")(sock, m, chatUpdate, store)
} catch (err) {
console.log(err)
}
}) `
i tested with console.log, but terminal didn't receive when new message sended to my phone
sorry for bad english
All other events are working fine,just messages aren't going there.🐥
Delete the async
Delete the async
Still same though, i think that's not in async function
@SamPandey001 use this for temporary workaround https://github.com/kbiits/Whiskey-Baileys
same here, not is triggering event messages.upsert, if i return to version 4.4 this is working fine, but this version not have latest functions
Still facing this issue in groups with temp messages aka expiry in 1 day.
Seems like this is not closed, I face the same issue. As @SamPandey001 has pointed out, seems like quite a simple solution: https://github.com/WhiskeySockets/Baileys/compare/master...kbiits:Whiskey-Baileys:master
if(!authState.creds?.myAppStateKeyId && !config.mobile) {
ev.buffer()
needToFlushWithAppStateSync = true
ev.flush() // <= Added this on the commit
}
Does this look like something that should be added here as well?
@fogolin I've forked the repository with the latest version and added the same code, I still have the same problems.
Closing stale open session for new outgoing prekey bundle
Closing session: SessionEntry
I don't know if this have anything related to the addTransactionCapability
. Here's my socket:
const { state, saveCreds } = await createMultiFileAuthState(
process.env.USER_DATA_DIR ?? '.session-data',
);
this.client = makeWASocket({
version,
printQRInTerminal: false,
logger: this.logger.pino as any,
auth: {
creds: state.creds,
keys: addTransactionCapability(state.keys, this.logger.pino as any, {
maxCommitRetries: 10,
delayBetweenTriesMs: 250,
}),
},
syncFullHistory: false,
generateHighQualityLinkPreview: true,
defaultQueryTimeoutMs: 0,
getMessage: this.getMessage,
browser: ['Chrome (Linux)', '', ''],
keepAliveIntervalMs: 10_000,
});
Ok. this is really a bummer, I'm having to make workarounds whenever dealing with messages and updates, upsert would really be an easier way to handle it, but I'll keep a lookout for this.
@fogolin I've managed to revert some changes here and now the issue is slightly better, I do receive those logs often but it's crashing when I am sending a text message to a group with lots of people.
Ok, I am facing a better performance by caching the group participants and sending them in the cachedGroupMetadata
in the sendText
method.
I have an open issue on my repo related to edited messages and we'll look into it sometime next week, I'll keep you posted if I find anything.
Seems like this is not closed, I face the same issue. As @SamPandey001 has pointed out, seems like quite a simple solution: https://github.com/WhiskeySockets/Baileys/compare/master...kbiits:Whiskey-Baileys:master
if(!authState.creds?.myAppStateKeyId && !config.mobile) { ev.buffer() needToFlushWithAppStateSync = true ev.flush() // <= Added this on the commit }
Does this look like something that should be added here as well?
no, I think the buffer shouldn't flushed there. Of course, the new messages aren't emitted in the upsert event because of it, but my workaround implementation is just a workaround to make it works.
The buffer was already flushed somewhere (I forgot, will look back into it again), but in fact, it's still not flushed.
Ok, I am facing a better performance by caching the group participants and sending them in the
cachedGroupMetadata
in thesendText
method.
@thereis Could you teach how you did this?
Hey there,it's been a long time,i didn't touch baileys in a long tho :P and now when i update baileys ^4.4.0 to WhiskeySockets/Baileys Userbot and i don't get messages in upserts but bot sends messages just after a successfull connection. Here is log.
What can be a possible reason it? thanks btw