Skip to content

Releases: rafaelsg-01/whatsapp-cloudflare-workers

6.7.16-worker-1.0.5

11 Mar 19:15
0e25f5c

Choose a tag to compare

Fix: WhatsApp Account Registration in Production

This PR fixes an issue preventing WhatsApp account registration in production due to high latency when retrieving the creds.json file.

Issue Description

The root cause was in the R2Bucket.put(filePath) function, responsible for storing creds.json. During local development, this operation was fast enough not to cause failures. However, in the production environment, higher latency resulted in the following incorrect flow:

  1. The startSock() function is executed twice during the registration process:

    • First execution: Requests the verification code and generates creds.json.
    • Second execution: Sends the creds.json generated in the first execution.
  2. The issue occurred because the second execution of startSock() started before R2Bucket.put(filePath) had finished storing creds.json. As a result, when calling R2Bucket.get(filePath), the value was still null, breaking the authentication flow.

Implemented Solution

To ensure creds.json is available before the second execution of startSock(), a verification loop was implemented every 200ms. The process waits until R2Bucket.put(filePath) completes before proceeding to the next registration step.

This approach ensures that production latency does not negatively impact the authentication flow.

6.7.16-worker-1.0.2

11 Mar 00:15

Choose a tag to compare

Just fixed a bug in dependencies

6.7.16-worker-1.0.1

09 Mar 23:38

Choose a tag to compare

Minor changes and addition to the readme

6.7.16-worker-1.0.0

09 Mar 22:36
afc6da6

Choose a tag to compare

Functional version 1 of Baileys WhatsApp for hosting on Cloudflare Workers, current functions:

  • Registration of multiple WhatsApp numbers
  • Sending messages