Repository navigation
fix(provider-sherpa): resolve the WA version automatically and recover from 405 - #1298
Merged
Merged
Conversation
…r from 405
The hardcoded fallback (2.3000.1023223821) and the version passed by the
templates (2.3000.1034028152) are both rejected by WhatsApp with
405 Connection Failure, and so is the version bundled with whaileys 6.3.8.
The raw `version` option was also spread after `version`, so it always won.
- Resolve the version on every connection: WA_VERSION / `version` option,
then the whaileys-recommended version, then the live WhatsApp Web
version, then a fallback verified against WhatsApp (2.3000.1043857760).
- Accept the text copied from wppconnect.io ('2.3000.1054953954-alpha').
- On 405, reconnect with the live WhatsApp Web version (up to 3 times),
then emit auth_failure explaining the manual fix.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Problem
@builderbot/provider-sherpafails with405 Connection Failure/ ERRO AUTH, same root cause as #1296 for Baileys:2.3000.1023223821and the version passed by the sherpa templates2.3000.1034028152are rejected by WhatsApp.whaileys@6.3.8itself (2.3000.1028340218) is rejected too....this.globalVendorArgswas spread afterversion, so the raw option always won.Live probe with
whaileys@6.3.8(fresh auth, provider browser descriptor), 2026-11-18:Fix
Mirrors #1296 (independent of it, no shared code between packages):
src/waVersion.ts: resolves the version on every connection —WA_VERSION/versionoption → whaileys-recommended (fetchLatestBaileysVersion, readscanove/whaileysmaster) → live WhatsApp Web (fetchLatestWaWebVersion) → fallback2.3000.1043857760. 5 s timeout per lookup.versionaccepts the text copied from wppconnect.io ('2.3000.1054953954-alpha') as well as arrays.versionnow goes after the spread, so resolution and recovery always apply.auth_failureexplaining the manual fix (wppconnect.io +WA_VERSION).pnpm run generate.templates).Verification
pnpm --filter @builderbot/provider-sherpa test: 95 passed (newwaVersion.test.ts+#WA versionprovider tests: auto, wppconnect text,WA_VERSIONprecedence, 405 recovery, 405 limit). The whaileys mock now exposes the default socket factory, soinitVendortests reach socket creation.new SherpaProvider({ version: [2, 3000, 1034028152] })→Notes
whaileys6.5.1 is available on npm (we pin 6.3.8); upgrading is out of scope here.