Pr182677 fix#201733
Open
izofis wants to merge 3 commits intowwebjs:mainfrom
Open
Conversation
Remove WAWebSyncGatingUtils monkey-patch and automatic PDO requests introduced in PR wwebjs#182677. These were force-enabling an internal AB flag and sending periodic sendPeerDataOperationRequest (type 4) calls, which WhatsApp's anti-automation system detects as suspicious activity leading to session termination and phone logout. - Remove gatingUtils.isPlaceholderMessageResendEnabled override - Remove pendingResend / requestResend / 5s flush timer - Remove onCiphertextFailedEvent exposeFunction - Simplify Msg.on('add') ciphertext handler message_ciphertext event and normal decrypt flow remain fully functional.
The onCiphertextFailedEvent exposeFunction and its 15s failTimer were removed as part of the previous commit. Remove the now-unreachable event constant and type overload to keep the public API consistent.
There was a problem hiding this comment.
Pull request overview
This PR removes the previously added “ciphertext failed after recovery” event pathway and the associated placeholder-message resend gating/resend logic from the WhatsApp Web injection layer, simplifying message handling and the public event surface.
Changes:
- Removed
message_ciphertext_failedevent constant and TypeScript typings. - Removed Puppeteer-exposed callback
onCiphertextFailedEventand the injected placeholder resend enablement/hardcoded gating override. - Removed pending resend batching and failure-timer logic tied to ciphertext placeholder recovery.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/util/Constants.js |
Removes the MESSAGE_CIPHERTEXT_FAILED event constant export. |
src/Client.js |
Removes injected WAWeb gating override and resend/failure handling related to ciphertext recovery and event emission. |
index.d.ts |
Removes the message_ciphertext_failed Client.on(...) overload and the Events enum entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
- Add connectionHealthCheck option to DefaultOptions (disabled by default) Phases: A) Socket.reconnect (8s), B) page.reload (90s), C) browser recreate - Add CONNECTION_LOST and CONNECTION_RECOVERED to Events enum - Add checkConnection() to detect ghost connections via WebSocket readyState - Add _waitForHealthyConnection(), _recoverConnection(), _recreateBrowserProcess() - Start health check interval in inject() after READY event - Add TypeScript types for new option and events in index.d.ts
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
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.
Description
Related Issue(s)
Testing Summary
Test Details
Environment
Type of Change
Checklist
npm test).index.d.ts) have been updated if necessary.example.js) / documentation have been updated if applicable.