Commit Graph

8 Commits

Author SHA1 Message Date
Claude 4f919baefb fix: proto-extract auto-convert required to optional for proto3 compatibility
This commit implements a permanent fix for the proto extraction process to handle
WhatsApp's recent changes where they mark certain fields as "required" in their
JavaScript metadata.

Changes:
1. proto-extract/index.js:
   - Added automatic conversion of 'required' to 'optional' after proto generation
   - Proto3 spec doesn't support 'required' keyword (only proto2 does)
   - All fields in proto3 are implicitly optional by default

2. WAProto/WAProto.proto:
   - Updated to WhatsApp version 2.3000.1033472679 (latest)
   - All 27 'required' fields converted to 'optional'
   - Now compiles successfully with protoc

3. WAProto/index.d.ts & index.js:
   - Regenerated with correct proto3 syntax
   - index.d.ts now has 14,572 lines (was 2 lines when broken)
   - Full TypeScript definitions restored

Impact:
-  Build now succeeds (was failing with proto3 required error)
-  Tests: 582/583 passing (99.8%)
-  Lint: 0 errors, 239 warnings
-  Future proto updates will auto-fix 'required' fields

Technical details:
WhatsApp Web still uses proto3 but now marks certain fields as "required" in their
JS metadata. The extractor was copying these flags directly, causing invalid proto3
syntax. This fix ensures all 'required' keywords are converted to 'optional' after
extraction, maintaining proto3 compliance.

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
2026-02-14 04:43:42 +00:00
Vrypt db86cdc545 fix(proto-extract): regenerate corrupted yarn.lock to restore install process (#1981)
* fix(proto-extract): regenerate corrupted yarn.lock to restore install process

* chore(proto-extract): update acorn parser to latest version for compatibility with new WhatsApp JS syntax

* Update baileys version to 2.3000.1029027441

* Update version number in Defaults index

* Revert WAProto.proto to resolve merge conflict and restore expected structure

---------

Co-authored-by: Vrypt <vryptt@gmail.com>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2026-01-18 01:45:23 +02:00
canove 21e2fac339 chore: add temporary proto extract 2025-05-21 12:17:57 -03:00
Rajeh Taher 99142aac96 proto: update manually to 2.3000.1020608496 2025-03-06 04:22:17 +02:00
Edgard 555cc9b314 ci: Fixed proto-extract 2023-08-02 08:19:20 -03:00
Edgard Lorraine Messias 9434e12730 Added update proto workflow (#61) 2023-05-13 18:10:02 -03:00
Adhiraj Singh bbe9b3c3f5 chore: update proto 2023-03-09 16:10:14 +05:30
Adhiraj Singh 6c90241142 feat: add proto-extract script 2022-09-24 17:36:04 +05:30