whatsapp-api-nodejs icon indicating copy to clipboard operation
whatsapp-api-nodejs copied to clipboard

Restore Sessions BUG

Open Zarinia opened this issue 1 year ago • 1 comments

in session.js line const result = await db.listCollections().toArray(); This is a bug that selects all collections like chat and creates an instance for the chat key We should select only keys and filter others.

Zarinia avatar Jul 20 '22 07:07 Zarinia

I temporarily changed to this way to fix the error But there are many ways to fix it Like reading from the chat table or inserting in a separate table

const db = mongoClient.db('direct-api');
	const result = await db.listCollections().toArray();
	result.forEach((collection) => {
		if (collection.name !== 'chats') {
			allCollections.push(collection.name);
		}
	});

Zarinia avatar Jul 20 '22 07:07 Zarinia