-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: implement dual confirmation system in sendSeen #3596
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
Open
elhumbertoz
wants to merge
10
commits into
pedroslopez:main
Choose a base branch
from
elhumbertoz:sendSeen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added functionality to send read and delivery confirmations in parallel. Integrated new methods to handle delivery confirmations. Improved error handling in the confirmation sending process.
…js y Utils.js Se realizaron ajustes en la indentación y el formato del código para mejorar la legibilidad. Se eliminaron líneas en blanco innecesarias y se unificó el estilo de las asignaciones de opciones en varias funciones.
Se ajustó la indentación y se eliminaron líneas en blanco innecesarias para optimizar la claridad del código. Se unificó el estilo de las asignaciones de opciones en la función de procesamiento de medios.
2 tasks
"Basándome en el texto proporcionado, aquí está el pull request en inglés:" |
It's all set; I removed a commit that didn't belong to this PR. |
Se ajustó la indentación y se eliminaron líneas en blanco innecesarias. Se agregó un intento de operación básica de envío de visto antes de las operaciones adicionales, mejorando así la estructura del código y la claridad en el flujo de ejecución.
Se eliminó la asignación innecesaria del resultado de la operación básica de envío de visto, optimizando así el flujo de ejecución y mejorando la claridad del código.
alechkos
reviewed
Jun 13, 2025
…e, t: timestamp, groupedReceipt: null, recipient: null}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix WhatsApp Web sendSeen Function: Implement Dual Confirmation System
🐛 Problem Description
The current
sendSeen()
function in whatsapp-web.js only implements half of WhatsApp Web's actual message confirmation system. Through reverse engineering of WhatsApp Web's obfuscated code, we discovered that the native implementation uses a dual confirmation system that executes both "seen" and "receipt" confirmations in parallel usingPromise.all()
.Current Issues:
TypeError: window.Store.Conn.isOnline is not a function
🔍 Root Cause Analysis
Discovery from Obfuscated Code Analysis
In the original obfuscated
module.js
, we found the main coordinator function:Key Finding: WhatsApp Web treats message confirmation as an atomic operation consisting of two parallel processes:
🛠 Solution
1. Update Store.js - Expose Missing Modules
Added missing receipt modules to the Store exposure:
2. Update Client.js - Main Fix
Replaced the entire
sendSeen
function to implement the dual confirmation system discovered through code analysis.3. Update Utils.js - Improve Core Function
Enhanced the core
WWebJS.sendSeen
function with:✅ Benefits
Immediate Fixes:
TypeError: window.Store.Conn.isOnline is not a function
Performance Improvements:
Architecture Improvements:
🧪 Testing
After implementing these changes:
client.sendSeen(chatId)
works without errors📁 Files Changed
src/Client.js
- Main sendSeen function implementationsrc/util/Injected/Store.js
- Exposed missing receipt modulessrc/util/Injected/Utils.js
- Enhanced core WWebJS.sendSeen function🔬 Technical Background
This fix is based on reverse engineering WhatsApp Web's obfuscated JavaScript code. The original discovery revealed that WhatsApp Web uses a sophisticated dual confirmation system:
The current whatsapp-web.js implementation only exposed the "seen" part (
WAWebUpdateUnreadChatAction
) but was missing the "receipt" part (WAWebSendReceiptJobCommon
). This fix completes the implementation while maintaining backward compatibility.📝 Notes
🏷️ Status
Type: Bug Fix
Priority: High
Scope: Core functionality