Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDO protocol (peer data operation): Get more history sync + better message retry mechanism #919

Merged
merged 15 commits into from
Aug 14, 2024

Conversation

PurpShell
Copy link
Collaborator

No description provided.

@PurpShell PurpShell marked this pull request as draft July 11, 2024 03:25
@whiskeysockets-bot
Copy link
Contributor

Thanks for your contribution.

The next step is to wait for review and approval to merge it to main repository

The community can help reacting with a thumb up (:thumbsup:) for approval and rocket (:rocket:) for who has tested it.

To test this PR you can run the following command below:

# NPM
npm install @whiskeysockets/baileys@WhiskeySockets/Baileys#feature/pdo-sync
# YARN v2
yarn add @whiskeysockets/baileys@WhiskeySockets/Baileys#feature/pdo-sync

@PurpShell PurpShell marked this pull request as ready for review July 12, 2024 01:04
Copy link
Contributor

@azudindaem azudindaem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and implemented

@adithyan-hermit
Copy link

How to use sock.fetchMessageHistory

@w3nder
Copy link
Contributor

w3nder commented Jul 15, 2024

nice

@azudindaem
Copy link
Contributor

How to use sock.fetchMessageHistory

get from the last conversation that you have.. after calling the fetchMessageHistory function, you will receive a message history notification, and here you can retrieve the last 50 messages from the chat..

const messageId = await sock.fetchMessageHistory(
	50,
	{
    	"remoteJid": "[email protected]",
		"fromMe": false,
		"id": "0054381C1C7B869DF00AF"
	},
	1700990261
)

@adithyan-hermit
Copy link

adithyan-hermit commented Jul 15, 2024

How to use sock.fetchMessageHistory

get from the last conversation that you have.. after calling the fetchMessageHistory function, you will receive a message history notification, and here you can retrieve the last 50 messages from the chat..

const messageId = await sock.fetchMessageHistory(
	50,
	{
    	"remoteJid": "[email protected]",
		"fromMe": false,
		"id": "0054381C1C7B869DF00AF"
	},
	1700990261
)

But sock.fetchMessageHistory is not a function in whiskeysockets/baileys@WhiskeySockets/Baileys#feature/pdo-sync it's not defined in sock. Do i need to define it?

@azudindaem
Copy link
Contributor

You can use await sock.sendPeerDataOperationMessage(pdoMessage) from outside. pdoMessage is a straightforward example for your implementation

@kwangmeng
Copy link

You can use await sock.sendPeerDataOperationMessage(pdoMessage) from outside. pdoMessage is a straightforward example for your implementation

Implemented and tested

@sudhansupujari
Copy link

You can use await sock.sendPeerDataOperationMessage(pdoMessage) from outside. pdoMessage is a straightforward example for your implementation

please provide some example , how to use ?

@PurpShell
Copy link
Collaborator Author

Will add today, no need for implementations

@kyraex
Copy link
Contributor

kyraex commented Jul 22, 2024

Will add today, no need for implementations

Does this will perform better than the current setup? Right now i only handle manual ack whenever a message is missing from node at an interval until the message is arrived. Sometimes it never arrive...

@PurpShell PurpShell marked this pull request as draft July 27, 2024 05:08
PurpShell and others added 6 commits July 27, 2024 17:08
* fix: profilePictureUrl (#901)

* Update module to latest version  (#926)

* Update package.json

Update the module to the latest

* Add files via upload

* Fix: Readme use upsert events (#908)

* Fix: getUSyncDevices (#862)

* Update messages-send.ts

* Update messages-send.ts

* Update messages-send.ts

* Fix lint

* Fix lint

* fix(master): update linting workflow to node 20 (current LTS)

---------

Co-authored-by: Akhlaqul Muhammad Fadwa <[email protected]>
Co-authored-by: Rizz2Dev <[email protected]>
Co-authored-by: Oscar Guindzberg <[email protected]>
Co-authored-by: Bob <[email protected]>
Revert "Update module to latest version  (#926)"
@PurpShell PurpShell marked this pull request as ready for review August 3, 2024 08:37
@PurpShell PurpShell merged commit 1f9cfb1 into master Aug 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants