Skip to content

Pr182677 fix#201733

Open
izofis wants to merge 3 commits intowwebjs:mainfrom
izofis:pr182677-fix
Open

Pr182677 fix#201733
izofis wants to merge 3 commits intowwebjs:mainfrom
izofis:pr182677-fix

Conversation

@izofis
Copy link
Copy Markdown

@izofis izofis commented Apr 28, 2026

Description

Related Issue(s)

Testing Summary

Test Details

Environment

  • Machine OS:
  • Phone OS:
  • Library Version:
  • WhatsApp Web Version:
  • Browser Type and Version:
  • Node Version:

Type of Change

  • Dependency change (package changes such as removals, upgrades, or additions)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-code change (documentation, README, etc.)

Checklist

  • My code follows the style guidelines of this project.
  • All new and existing tests pass (npm test).
  • Typings (e.g. index.d.ts) have been updated if necessary.
  • Usage examples (e.g. example.js) / documentation have been updated if applicable.

izofis added 2 commits April 28, 2026 13:50
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.
Copilot AI review requested due to automatic review settings April 28, 2026 10:52
@github-actions github-actions Bot added api changes API modifications typings Type definitions utility Utility code labels Apr 28, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_failed event constant and TypeScript typings.
  • Removed Puppeteer-exposed callback onCiphertextFailedEvent and 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.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api changes API modifications typings Type definitions utility Utility code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants