46 Commits
Author SHA1 Message Date
jfengandClaude Opus 5.5 997bbc85c2 merge: promote maintained-stable (v0.7.2-evogo.3) into main
Build Automatico / build (push) Successful in 27s
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 4m26s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 09:19:57 -03:00
jfengandClaude Opus 5.5 b140fdb390 fix(send): send to known LIDs passed as phone numbers; expose version
Docker - Build e Publicacao / Build, Scan e Publicacao (push) Successful in 2m28s
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 3m58s
Docker - Promover latest / Promover release para latest (push) Successful in 4m39s
Integrations that store the contact's LID as its number (255284433936406)
failed with 'no LID found for [email protected]'. When the number
is not a registered phone and the instance's LID store maps it to a phone
number, send to <number>@lid instead.

GET /server/ok now also returns the running version, so a deployment can be
checked without reading the startup log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
v0.7.2-evogo.3
2026-11-11 08:15:58 -03:00
jfengandClaude Opus 5.5 c9511a636e ci: retry registry login, pull and push
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 1m48s
A transient timeout on the registry token endpoint failed the publication of
v0.7.2-evogo.2 (run 482) after the image had already been built and scanned.
Login, pull and push now retry up to 5 times with linear backoff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 07:52:15 -03:00
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]>
v0.7.2-evogo.2
2026-11-10 21:11:49 -03:00
jfengandClaude Opus 5.5 03d619bb55 ci: promote last v* release in maintained-stable to :latest without rebuilding
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 4m8s
Docker - Build e Publicacao / Build, Scan e Publicacao (push) Successful in 2m42s
Docker - Promover latest / Promover release para latest (push) Successful in 2m18s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 13:40:58 -03:00
jfengandClaude Opus 5.5 0379082181 ci: daily upstream merge with PR/issue, tag-based image publishing
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 3m33s
Docker - Build e Publicacao / Build, Scan e Publicacao (push) Successful in 3m48s
- scripts/upstream-sync.sh + upstream-sync-check.yml: fast-forward upstream-sync,
  merge upstream into maintenance/sync-upstream-<sha> from maintained-develop,
  build/vet/test, open PR (or Issue on conflict), warn on newer whatsmeow.
  Optional AUTO_MERGE_UPSTREAM repo variable; maintained-stable never touched.
- docker-build.yml: publish git.jf.eng.br/jfeng/evogo:<version> and
  <version>-<sha7> on tag v*, startup smoke test, non-blocking Trivy scan,
  :latest only on explicit promote_latest.
- CHANGELOG and maintenance docs updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
v0.7.2-evogo.1
2026-11-09 13:12:32 -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
jfengandClaude Opus 5.5 abaac8eb93 fix(build): import waWa6 for ClientPayload_UserAgent_AppVersion
maintained-develop (after PR #1) did not compile: whatsmeow.go referenced an
undefined waProto package. The AppVersion type lives in
go.mau.fi/whatsmeow/proto/waWa6. Also gofmt the file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 13:12:27 -03:00
jfengandClaude Opus 5.5 4998ab3d45 fix(whatsmeow): harden client lifecycle against duplicate starts and races
- Skip a second StartClient while one is starting (adapted from upstream PR #239).
- Do not restart a client without a paired device; it would cycle QR codes
  forever (adapted from upstream PR #240).
- Serialize ReconnectClient per instance and nil-check the client: two
  Disconnected events in the same second dereferenced a removed client and
  killed the whole process (upstream issue #188).
- safemap.TrySend / TrySendTimeout: kill-channel sends no longer panic with
  "send on closed channel" when the instance is deleted during QR handling
  (upstream issue #222).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 12:04:18 -03:00
jfengandClaude Opus 5.5 74389cc8de fix(instance): do not clear event subscriptions on disconnect
Adapted from upstream PR #187 (guipratiko). Clearing instance.Events left the
instance with an empty events string after reconnecting, so CallWebhook dropped
every webhook.

Also send kill signals through safemap.TrySend/TrySendTimeout so a channel
closed by a concurrent instance delete no longer panics the process
(upstream issue #222).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 12:04:16 -03:00
jfengandClaude Opus 5.5 c33b4d98fd fix(utils): strip plus prefix from user JIDs in ParseJID
Adapted from upstream PR #224 (danie1net0). Queries addressed to
"+<number>@s.whatsapp.net" are never answered by WhatsApp and hang until
the IQ timeout (upstream issue #223: /user/info and /user/avatar hang 75s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 12:04:14 -03:00
EcoosUP fc35d72029 fix(whatsmeow): back off the reconnect loop instead of spinning forever
An instance whose device was logged out from the phone never stops restarting:

    Disconnected -> ReconnectClient -> instance comes up with no session
    -> QR -> nobody scans -> max QR count -> forced logout -> Disconnected

Measured in production: 110 reconnects and 1135 QR codes in 50 minutes from a
single instance, stopping only when a human noticed.

Nothing counted those restarts, because from ReconnectClient's point of view
every turn succeeds — the instance really does come up. What fails afterwards is
the pairing, and nobody was measuring that.

The first 5 restarts inside a 15 minute window still go straight through: that
is the good case, a healthy instance that lost its websocket and has to return
within seconds. Past that the loop becomes a growing wait (5, 15, 30 minutes)
and the instance keeps trying — a backoff, not a give-up.

Only one goroutine waits per instance. Without that guard, every Disconnected
arriving during the wait would stack another one and the backoff would become
the loop it was written to stop.

(cherry picked from commit 3b52f1c457406dc2540f7e17467b6c30e9304f7b)
2026-11-09 12:01:35 -03:00
Guilherme Souza 3fce4dbcca fix(whatsmeow): share one sqlstore.Container for auth DB
StartClient called sqlstore.New on every instance start, opening a new
*sql.DB and re-running Upgrade against PostgresAuthDB. A few parallel
QR/reconnects saturated PgBouncer (75 = 60+15) with bad connection.

Reuse the pooled authDB from initPostgresAuthDB via NewWithDB + Upgrade
once (sync.Once on a heap-allocated sharedSQLStore so value-receiver
StartClient is safe). Users/GORM DB stays separate. Do not Close the
shared container on disconnect — main owns authDB.

(cherry picked from commit f2a73c715a286aefa5c10fa8521dccc7efa56581)
2026-11-09 12:01:15 -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
prakash-dev-code a5f7e1c98a fix(websocket): deliver events to every subscriber of an instance
The websocket producer kept a single connection per instance in
`clients map[string]*websocket.Conn`. Registering a second subscriber
silently replaced the first, and `RemoveClient` deleted the whole instance
entry when either one disconnected. Consuming events in two browser tabs
therefore delivered to only the most recent one, and closing that tab cut
delivery for the remaining subscriber too.

Changes:

- `clients` becomes `map[string][]*client`. Deregistration now matches the
  specific connection instead of removing the instance entry, so sibling
  subscribers keep receiving events.
- Each connection carries its own write mutex. Events are dispatched from
  independent goroutines (the `go CallWebhook` calls in the whatsmeow event
  handler) and gorilla/websocket permits only one concurrent writer per
  connection, so two simultaneous events could interleave writes on the
  same socket.
- `Produce` snapshots the subscriber list under the read lock and performs
  writes outside it, so a slow or half-open socket no longer blocks
  deliveries for other instances.
- Failed writes prune the dead connection, and `Produce` now returns nil.
  `sendToQueueOrWebhook` aborts the remaining producers when one returns an
  error, so a closed browser tab previously suppressed RabbitMQ, NATS and
  webhook delivery for that same event.

Verified with two concurrent subscribers on one instance: both receive
identical event streams, and disconnecting one leaves the other unaffected.

(cherry picked from commit 1db4408244fe75b39c2b4e1bbb8e681679dd7dae)
2026-11-09 12:01:02 -03:00
lojanica a0c74485b8 test(nats): refactor tests and add global events state assertion
(cherry picked from commit 1860110296ea775734752be8a40b93726c34ff27)
2026-11-09 12:01:00 -03:00
root a4add7cc5e fix: skip NATS connection when URL is empty
(cherry picked from commit a3c05b41717bc652ef7736cc2c2b22c4eaed0f5d)
2026-11-09 12:01:00 -03:00
EcoosUP 3cc5192b7b fix(whatsmeow): Archive event panics before reaching the webhook
The Archive case asserts postMap["data"] to map[string]interface{}, but at that
point it still holds the raw *events.Archive. The assertion panics on every
archive event:

    Event handler panicked while handling a *events.Archive:
    interface conversion: interface {} is *events.Archive,
    not map[string]interface {}

whatsmeow recovers the panic and logs it, so nothing crashes — the event simply
never reaches the webhook, silently.

Every other case in this switch marshals and unmarshals postMap["data"] into a
map before asserting. Archive was the only one missing that step. Six call sites
do the assertion; the other five are already guarded.

(cherry picked from commit 16c4be6e9a0ae8a0bbc41f8b2790a362a7a4e2e2)
2026-11-09 12:00:59 -03:00
jfeng 87a354aee8 Merge pull request 'fix: resolver erro Client outdated (405) com whatsmeow atualizado e handshake dinamico' (#1) from fix/client-outdated-405 into maintained-develop
CI - Validacao Go / Validar Codigo e Testes (push) Failing after 2m15s
Reviewed-on: #1
2026-11-09 14:45:05 +00:00
jfeng ca673bd1d4 docs(governance): update AGENTS.md with EvoGO maintenance guidelines
Build Automatico / build (push) Successful in 31s
2026-11-09 14:19:41 +00:00
jfeng 245510315c chore: sync maintenance documentation and workflows into fix branch
CI - Validacao Go / Validar Codigo e Testes (pull_request) Failing after 3m53s
CI - Validacao Go / Validar Codigo e Testes (push) Failing after 4m46s
2026-11-09 11:17:53 -03:00
jfeng 25117bd2c1 chore(governance): add AGENTS.md, maintenance documentation, Gitea workflows and sync monitoring scripts
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 5m59s
2026-11-09 11:17:45 -03:00
jfeng 91c1d0697f fix(handshake): apply dynamic store.SetWAVersion and UserAgent to prevent 405 error 2026-11-09 11:12:27 -03:00
MayconVM 70ecc1746c fix(makefile): read release version from CHANGELOG heading
The old pattern 'grep -om1 "v[0-9].*"' matched the first vN.N.N anywhere in
the file, so any mention of a module pseudo-version above the release heading
silently corrupted the build version (e.g. it produced
"v0.0.0-20261102152715-54038813c47f`." as main.version). Anchor it to the
## vX.Y.Z heading instead.
2026-11-09 11:11:21 -03:00
MayconVM ab5f84213f docs: record whatsmeow bump, Go 1.26 requirement and blocklist response change 2026-11-09 11:11:21 -03:00
MayconVM 99b4d78f62 deps: bump whatsmeow to 2026-11-02 (fix 405 client outdated)
whatsmeow was pinned to 2026-06-30 (v0.0.0-20260630180629-b572e5bcb92b),
which predates WhatsApp's minimum client version bump and causes
405 client-outdated connect failures.

- go.mau.fi/whatsmeow -> v0.0.0-20261102152715-54038813c47f
- go.mau.fi/util 0.9.10 -> 0.11.0, x/{crypto,net,sync,sys,text,tools} bumped
- go directive 1.25.0 -> 1.26.0 (upstream minimum), Dockerfile builder
  golang:1.25.0-alpine -> golang:1.26.10-alpine

API adaptations:
- UpdateBlocklist/GetBlocklist now take a dhash argument
- SetStatusMessage takes types.SetStatusInput (text behind mex query)

Store schema upgrades to v16 (companion_meta_nonce, wasa_root_secret_id)
run automatically on container open; verified against a v14 sqlite auth DB.
2026-11-09 11:11:21 -03:00
jfeng 4ddea7cd3d Initial commit 2026-11-09 13:48:37 +00:00
github-actions[bot] 9337afc47e sync: 0.7.2 from main (6164dced8d3ab8f9bcce9bf333fb4e8663760ff1) 0.7.2 2026-07-03 01:55:33 +00:00
github-actions[bot] 0f9ef308d2 sync: 0.7.1 from main (ca1956a7559d4e178ed2d61edcfa4cb241804e45) 2026-05-06 17:40:31 +00:00
github-actions[bot] 04e4515995 sync: 0.7.1 from main (202dfd9cd5c04f25a9e5182230383d2511e90ad7) 2026-05-06 17:38:21 +00:00
Davidson GomesandClaude Opus 4.7 fa2829803f docs(org): update GitHub URLs from EvolutionAPI to evolution-foundation
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-06 14:36:03 -03:00
github-actions[bot] 8715f2b9f7 sync: 0.7.1 from main (49e2584ceccfc9234198c3ee101f8d32178eaf8d) 2026-05-06 17:15:28 +00:00
github-actions[bot] 0563e893b5 sync: 0.7.1 from main (187bdc0d31824d0b13c91a2c91eefde3d9e41627) 2026-05-06 17:12:52 +00:00
github-actions[bot] 9746961e1d sync: 0.7.1 from main (932e7161d45e9007f28de333744482b80ba29dc2) 2026-05-06 17:10:27 +00:00
Davidson Gomes e56007b6e2 Merge branch 'chore/standardize-readmes-2026-05' into main 2026-05-06 14:03:20 -03:00
Davidson GomesandClaude Opus 4.7 78991d1cd0 chore(docs): standardize README, LICENSE, NOTICE, TRADEMARKS to Evolution Foundation 2026
- Apache 2.0 license with © 2026 Evolution Foundation
- Standardized README structure (header, badges, footer)
- Unified contact: [email protected]
- Unified URLs: evolutionfoundation.com.br + docs.evolutionfoundation.com.br
- Added/updated NOTICE, TRADEMARKS.md, SECURITY.md, CONTRIBUTING.md
- Canonical cover image at public/hover-evolution.png

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-06 13:52:45 -03: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] 182a719053 sync: 0.6.1 from main (b5abe7465d4c5e70c055b9015416f95d4b434221) 2026-03-25 22:27:23 +00:00
github-actions[bot] 1dc30b6c7e sync: 0.6.1 from main (94dc2dd8a672f3b905c121d7a4b70b3378bfd69e) 2026-03-25 21:51:59 +00:00
github-actions[bot] 8a8c75acd1 sync: 0.6.1 from main (3b80d4d7a6178c40558d130535fb26bbde8cf9f4) 2026-03-25 21:14:56 +00:00
github-actions[bot] e114b838f2 sync: 0.6.1 from main (a713cf7b2dd1ff08528a121913ede8bd2cd3ffbd) 2026-03-25 21:11:09 +00:00
github-actions[bot] f40d1578c6 sync: 0.6.1 from main (306dc06dd9221ebf75fc545f61b35a2d0e533d18) 2026-03-25 21:04:33 +00:00
github-actions[bot] ce6ae7123c sync: 0.6.1 from main (11ff7d7c1aa94cd5d76633c362b3104b74ec873e) 2026-03-25 21:00:16 +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