Commit Graph
8 Commits
Author SHA1 Message Date
jfengandClaude Opus 5.5 5b71495e93 fix(send): resolve Brazilian 9th digit by asking WhatsApp for both variants
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 2m42s
Docker - Build e Publicacao / Build, Scan e Publicacao (push) Successful in 1m23s
Accounts created before the 9th digit rollout are still registered without it
(554291389691), newer ones with it (5542991389691). The DDD-based rewrite in
CreateJID cannot be right for every account, and the existence check queried
only the number as received, so sends to 5542991389691 failed for an account
registered as 554291389691.

validateAndCheckUserExists now queries both forms in one IsOnWhatsApp call and
uses the registered one (received form first). Non-Brazilian numbers, groups,
LIDs and landlines follow the previous path unchanged. Related: upstream
issue #214 / PR #208.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-10 21:11:49 -03:00
jfengandClaude Opus 5.5 e02441fc4e style: gofmt files touched by the community fixes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 13:12:30 -03:00
EcoosUP 0c4ac7d9a9 fix(concurrency): guard the three shared maps with a mutex
clientPointer, myClientPointer and killChannel are created once at startup and
passed by reference into eleven packages. All of them read and wrote those plain
Go maps from different goroutines, with no synchronisation.

Go does not tolerate that: the runtime kills the process with

    fatal error: concurrent map writes

and a fatal error is not recoverable — a deferred recover() does not catch it.

Measured in production: the process died inside StartClient while five instances
were connecting at once. The orchestrator restarted it within seconds, but every
number was offline in the meantime, and it repeats on any restart that brings up
more than a couple of instances together.

The three maps become safemap.Map[T], a generic wrapper over a RWMutex. It lives
in its own package because MyClient is defined in pkg/whatsmeow/service, and
putting the type there would create an import cycle with the ten packages that
receive the maps.

98 call sites changed across 12 files, with the compiler as the judge: anything
missed is a build error, not a silent bug.

Tests: with -race, a plain map running the same exercise reports DATA RACE and
fails, while safemap.Map passes. Both halves verified.

(cherry picked from commit 3860fa278dc2b901705ffbddbed5cf59d70a85e4)
2026-11-09 12:01:08 -03:00
github-actions[bot] 9337afc47e sync: 0.7.2 from main (6164dced8d3ab8f9bcce9bf333fb4e8663760ff1) 2026-07-03 01:55:33 +00:00
github-actions[bot] 46d787faff sync: 0.7.1 from main (7520d2e552ed19b2f24e861e910e197310bf55f5) 2026-04-24 23:29:11 +00:00
github-actions[bot] fdf612350a sync: 0.7.0 from main (3f0d10f172101035f4e0f736695e1700ee1ec967) 2026-04-17 18:41:28 +00:00
github-actions[bot] e319b8b8d8 sync: 0.6.1 from main (d2270ddac1307da38af1affd55840e19d9c4a298) 2026-03-25 16:15:07 +00:00
Davidson Gomes 877eef7f07 release: v0.6.1 2026-03-25 12:40:16 -03:00