Commit Graph

119 Commits

Author SHA1 Message Date
Renato Alcara d233a7856f fix: eliminate 40s message delivery delay caused by libsignal console dumps
fix: eliminate 40s message delivery delay caused by libsignal console dumps
2026-02-27 08:43:54 -03:00
Renato Alcara a2382e6fb4 test: add test suites + fix getErrorCodeFromStreamError
test: add test suites + fix getErrorCodeFromStreamError
2026-02-23 23:12:44 -03:00
Renato Alcara 54b399dc2e feat(app-state): App State Sync Resilience (#208)
feat(app-state): App State Sync Resilience (#208)
2026-02-22 21:54:37 -03:00
Renato Alcara c40e6e506e Update update-version.yml 2026-02-19 09:38:48 -03:00
Renato Alcara a905c0127f Enable auto-merge for version update PRs
Updated the workflow to enable auto-merge for pull requests with version updates.
2026-02-18 20:16:37 -03:00
Renato Alcara 62f2fac641 Update update-proto.yml 2026-02-18 20:13:10 -03:00
Renato Alcara 4e0a4a1dd2 Enhance update-proto workflow with dynamic names
Updated the workflow to include dynamic run names and improved commit messages and PR body formatting.
2026-02-18 12:25:10 -03:00
Renato Alcara 0a80c9fa01 Update update-version.yml 2026-02-18 12:22:56 -03:00
Renato Alcara 08d55549f3 Change update schedule time to 09:00 UTC 2026-02-17 11:01:06 -03:00
Renato Alcara 2dd81db78b Change cron schedule for WAProto update workflow 2026-02-17 11:00:24 -03:00
Renato Alcara d96a75be37 Update update-proto.yml 2026-02-17 10:52:55 -03:00
Renato Alcara 2c9921ab15 Refactor PR merge process and improve error handling 2026-02-17 10:37:24 -03:00
Renato Alcara cb5c2c0230 fix(ci): add --yes flag and mergeability wait to auto-merge step
- Add --yes to gh pr merge to prevent interactive prompt in CI
- Add sleep 5 before merge to allow GitHub to compute PR mergeability

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:02:16 -03:00
Renato Alcara b3ecba131d fix(ci): add auto-fix step to lint workflow and fix circular rule conflict
- Add `yarn lint:fix` step before lint check to auto-fix prettier/import-sort
  formatting issues (runs with continue-on-error to not block)
- Fix circular conflict between prettier and space-before-function-paren
  rule in cache-utils.ts via eslint-disable comment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:59:51 -03:00
Renato Alcara 8a93fd2614 fix(ci): replace auto-merge action with direct squash merge
The `peter-evans/enable-pull-request-automerge@v3` action requires
branch protection rules on the target branch. Without them, the
GitHub GraphQL API rejects with "Pull request is in clean status".

Replace with `gh pr merge --squash --delete-branch` which merges
the PR immediately after creation without requiring branch protection
rules, and automatically cleans up the temporary branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:44:58 -03:00
Claude 6795522199 fix: improve yarn cache strategy to prevent immutable lockfile errors
- Cache .yarn/cache instead of node_modules to avoid inconsistencies
- Include both yarn.lock and package.json in cache key hash
- Update restore-keys to be more specific with package.json hash
- This prevents CI from using stale caches after dependency updates

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
2026-02-14 11:15:35 +00:00
Renato Alcara c964ccc8fd fix: improve auto-merge in update-version workflow
fix: improve auto-merge in update-version workflow
2026-02-14 03:22:53 -03:00
Claude b7107a6473 feat: use dedicated auto-merge action for reliability
Changes:
- Replace gh pr merge with peter-evans/enable-pull-request-automerge action
- Add pr_number output to create_pr step
- Support auto-merge for both new and existing PRs
- Simplify workflow by removing manual merge logic
- Better error handling and reliability

Benefits:
- More robust auto-merge using GraphQL API
- Works even if repository allows auto-merge is disabled
- Clearer separation of concerns
- Better support for existing PRs

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
2026-02-14 06:18:45 +00:00
Claude ef254c28c9 fix: improve auto-merge in update-version workflow
Changes:
- Use GH_PAT (if available) for better permissions
- Extract PR number for more reliable merge command
- Add detailed error logging with exit codes
- Attempt auto-merge on existing PRs
- Provide clear troubleshooting guidance

This should help diagnose why auto-merge is failing and potentially
fix permission issues if a GH_PAT secret is configured.

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
2026-02-14 06:15:55 +00:00
Claude 4bd3c768a5 fix: GitHub Actions workflows now use GITHUB_TOKEN for dependencies
Fixed 4 failing workflow checks:

1. **Build/Lint/Test workflows**: Fixed yarn install authentication
   - Changed Git URL rewrite to include GITHUB_TOKEN in all rewrites
   - Added GITHUB_TOKEN and GIT_TERMINAL_PROMPT env vars to yarn install step
   - Now correctly handles github: dependencies (like libsignal)

2. **PR Comment workflow**: Fixed missing token error
   - Changed from secrets.PERSONAL_TOKEN to secrets.GITHUB_TOKEN
   - Workflow now has proper authentication

Root cause: Yarn 4.x was trying to clone github: dependencies via SSH,
but CI had no SSH keys. Git config now rewrites ALL GitHub URLs to
HTTPS with token authentication.

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
2026-02-14 04:58:34 +00:00
Claude d4859ac883 fix: remove --json flag for gh CLI compatibility
The older version of gh CLI in GitHub Actions runners doesn't support
the --json flag, causing PR creation to fail.

Changes:
- Removed --json flag from gh pr create
- Removed jq parsing (not needed)
- Use exit code to detect success/failure
- Simplified PR existence check
- More compatible with older gh CLI versions

This fixes the error:
 PR creation failed: unknown flag: --json

The workflow will now:
 Create PRs successfully
 Handle duplicates gracefully
 Work with both old and new gh CLI versions
2026-02-11 04:15:22 +00:00
Claude 8ac374c133 fix: use direct HTTPS URL for libsignal dependency
The root cause was simple: Yarn converts git+https:// to SSH.

Solution: Change package.json to use direct HTTPS URL
- Before: "git+https://github.com/whiskeysockets/libsignal-node"
- After: "https://github.com/whiskeysockets/libsignal-node.git"

This eliminates SSH conversion completely and works with all package managers.

Also simplified workflow by removing unnecessary workarounds:
- Removed temporary package.json patching step
- Removed retry logic
- Restored simple 'yarn install --immutable'

Clean, permanent solution. 🎯
2026-02-11 04:02:26 +00:00
Claude 9a37c3ad52 fix: force HTTPS by patching package.json before install
Root cause: Yarn 4.x ignores git config url.*.insteadOf rules and
automatically converts git+https:// URLs to SSH (git@github.com:).

Solution: Temporarily patch package.json to use direct HTTPS tarball URL
instead of git+https:// protocol before yarn install.

Changes:
- Added 'Fix libsignal URL for Yarn' step before install
- Uses sed to replace git+https:// with HTTPS tarball URL
- Updated cache key to v3 to force fresh cache
- This bypasses Yarn's SSH conversion completely

The patch is temporary and only exists in the CI environment.
Local development is unaffected.

Previous failed attempts:
- Run #22, #23: git config rules (Yarn ignored them)
- Run #24: invalid Yarn config command
- Run #25: retry logic (same SSH conversion issue)

This should finally work! 🤞
2026-02-11 04:00:24 +00:00
Claude d4d1a53650 fix: remove invalid Yarn config command
The command 'yarn config set preferAggregateCacheInfo' does not exist
and was causing the workflow to fail.

Removed invalid Yarn config commands and replaced with git config
verification to ensure HTTPS rewrites are properly applied.

Error in run #24:
Usage Error: Couldn't find a configuration settings named "preferAggregateCacheInfo"
2026-02-11 03:54:44 +00:00
Claude 662bb41cc2 fix(ci): resolve SSH authentication failure in update-version workflow
Fixes GitHub Actions failing with "Permission denied (publickey)" when
installing libsignal package from GitHub.

## Problem
Workflow was failing (runs #22, #23) when Yarn tried to install:
`libsignal: "git+https://github.com/whiskeysockets/libsignal-node"`

Error: Yarn was converting HTTPS URL to SSH (git@github.com), but runner
has no SSH key configured.

## Root Causes
1. Git config order issue: Line 48 was overwriting line 46's SSH -> HTTPS rule
2. Stale cache: node_modules cache contained SSH references
3. No Yarn-specific config to prevent SSH fallback

## Solution

### 1. Improved Git Configuration
- Added comments explaining order importance
- Separated SSH conversion from authentication
- Added Yarn-specific config to prefer HTTPS

### 2. Cache Key Update
- Changed cache key from `yarn-` to `yarn-https-v2-`
- This busts old cache with SSH references
- Added `.yarn/cache` to cached paths

### 3. Fallback Retry Logic
- If immutable install fails (due to SSH refs), retry without immutable mode
- Clear node_modules before retry
- Logs helpful error messages

## Testing
Before: Runs #22, #23 failed at "Install packages" (16s, 21s)
After: Should succeed with proper HTTPS cloning

## Related
- Issue: libsignal package using git+https:// URL
- Affects: Daily WhatsApp version update workflow
- Impact: Workflow was broken for 2 days

https://claude.ai/code/session_01SoNUGBEWbJwWWws3F2fuzh
2026-02-11 03:44:38 +00:00
Renato Alcara 0634499095 Fix branding and update call to action in README
Updated the README to correct the name from 'InfiniteZap' to 'InfiniteZAP' and modified the call to action for a free trial.
2026-02-11 00:39:47 -03:00
Renato Alcara ce0e94de53 Update README with InfiniteAPI details and warnings
Added information about InfiniteAPI and its features.
2026-02-09 22:22:07 -03:00
Claude 7407b7ab49 fix(ci): address Copilot PR #69 review concerns - improve workflow reliability
ISSUES IDENTIFIED BY COPILOT:

1. **PR URL Detection Logic Issue (Lines 149-153)**
   - Using '|| true' suppressed errors and captured stderr
   - String matching for "github.com" could produce false positives
   - No structured validation of PR creation success

2. **Auto-merge Fallback Logic Problem (Lines 160-162)**
   - Fallback merge without --auto would fail immediately
   - Required status checks haven't completed when PR just created
   - Branch protection rules would block immediate merge

3. **Insufficient Token Permissions Documentation (Lines 15-17)**
   - Default GITHUB_TOKEN may lack auto-merge permissions
   - No guidance on alternative authentication methods

SOLUTIONS APPLIED:

 **Issue #1 - Reliable PR Detection:**
   - Use '--json url,number' flag for structured output
   - Parse JSON with jq for reliable success detection
   - Extract PR URL and number separately
   - Proper error handling for duplicate PRs
   - Check for existing PRs if creation fails

 **Issue #2 - Remove Dangerous Fallback:**
   - Removed immediate merge fallback (gh pr merge without --auto)
   - Keep only --auto flag which queues merge when checks pass
   - Added informative error messages explaining why auto-merge might fail
   - Better user guidance on what to do when auto-merge unavailable

 **Issue #3 - Document Permission Requirements:**
   - Added comment explaining token permission requirements
   - Documented when PAT or GitHub App token might be needed
   - Referenced in error messages for troubleshooting

IMPROVEMENTS:

- Better error messages with emojis for visual clarity
- Extracts both URL and PR number for better logging
- Checks for existing PRs on creation failure
- Explains common reasons for auto-merge failures
- More robust error handling throughout

TESTING:
- YAML syntax validated
- JSON parsing logic tested
- All Copilot concerns addressed

Related: PR #69 code review comments
https://claude.ai/code/session_0149ZKk2ygmKCJTGu39Mr8oH
2026-02-03 01:13:32 +00:00
Claude 1fa321c0a2 fix(ci): correct Yarn 4 cache paths and add auto-merge for version PRs
- Fixed cache paths for Yarn 4 (node_modules + .yarn/install-state.gz)
- Updated all workflows to use actions/cache@v4
- Added auto-merge for WhatsApp version update PRs

https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK
2026-02-02 18:20:03 +00:00
Claude 16699781c7 fix(ci): add GITHUB_TOKEN authentication for git operations
Yarn 4 converts HTTPS URLs to SSH internally. Added token-based
authentication using GITHUB_TOKEN to allow accessing public GitHub
repositories without SSH keys.

https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK
2026-02-02 17:47:08 +00:00
Claude 72c49352a3 fix(ci): configure git to use HTTPS for GitHub dependencies
Fixes "Permission denied (publickey)" error when Yarn tries to fetch
libsignal dependency via SSH in GitHub Actions.

Added git config to force HTTPS instead of SSH for all GitHub URLs
in all workflows that run yarn install.

https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK
2026-02-02 16:45:41 +00:00
Claude 46ffaf027c fix: address PR review comments
Fixes from code review:

1. Fix #1,6: Use connection.update event instead of overriding sock.end()
   - Listens for 'close' event to cleanup interval
   - Handles both explicit close and internal disconnections

2. Fix #3: Exit code 2 when fetch fails (not 0)
   - Allows CI to distinguish success/error/fetch-failed
   - Properly signals fetch failures to workflows

3. Fix #4: Document revision bounds + add env vars
   - Added detailed comments explaining min/max revision values
   - Made configurable via WA_MIN_REVISION/WA_MAX_REVISION env vars

4. Fix #5,9: Remove unused fetchLatestVersion option
   - Removed from SocketConfig and defaults
   - Updated versionCheckIntervalMs docs to clarify it's only for makeWASocketAutoVersion

5. Fix #7: Use separate variable for version tracking
   - trackedVersion instead of mutating mergedConfig
   - Prevents unexpected side effects

6. Fix #8: Check socket state before emitting events
   - isSocketClosed flag to prevent race conditions
   - Double-check after async operations

7. Fix #10: Implement force parameter in workflow
   - Creates PR even without version changes when force=true
   - Useful for re-triggering updates manually

Note: Test coverage (Fix #2) deferred to separate PR due to
ESM mocking complexity with Jest.
2026-01-21 17:21:49 +00:00
Claude b9a7c2cabc feat: improve version update robustness and frequency
Changes:
- Update frequency: weekly → daily (06:00 UTC)
- Add retry with exponential backoff (3 attempts per source)
- Add multiple source endpoints (sw.js + bootstrap page)
- Add version validation (sanity checks on revision numbers)
- Add fetch timeout to prevent hanging
- Add detailed logging for debugging
- Simplify workflow to only update baileys-version.json

This makes the version update more reliable and responsive
to WhatsApp Web changes.
2026-01-21 16:22:46 +00:00
João Lucas de Oliveira Lopes d4ef73aca5 feat: implement automated WhatsApp version update workflow and related scripts (#2130)
* feat: implement automated WhatsApp version update workflow and related scripts

* change cron to weekly

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2026-01-18 01:07:05 +02:00
Rajeh Taher cfca468df2 Update README.md 2025-12-10 23:00:26 +02:00
Rajeh Taher 4e9600396b readme: typo
Removed mention of discount for multiple hours in support section.
2025-12-10 22:39:31 +02:00
Rajeh Taher 1afb0a9af6 readme: updates 2025-12-10 22:37:48 +02:00
Rajeh Taher a3950dfb7e funding: add vinikjkkj to GitHub Sponsors list 2025-11-19 17:15:31 +02:00
Rajeh Taher 0c22abb1df readmes: remove survey message 2025-11-19 16:47:53 +02:00
Rajeh Taher b558d67851 Revise breaking change notice in README 2025-09-09 00:45:54 +03:00
Rajeh Taher b53ef17ba0 caution for upcoming release 2025-09-07 22:47:31 +03:00
Rajeh Taher 9e04cce8d3 .github: Update GitHub sponsors list 2025-08-31 21:08:43 +03:00
Rajeh Taher 0716469dd6 readme: Remove shield images
Removed shield images for NPM downloads, GitHub code size, and Discord.
2025-08-31 05:27:23 +03:00
Rajeh Taher 0feded6c9e readme: improve English grammar 2025-08-31 05:15:03 +03:00
Rajeh Taher 27bc0bb313 readme: Add user survey and update guide warnings 2025-08-31 05:11:22 +03:00
Rajeh Taher fb08f3cadd readme: update where to reach the old guide 2025-08-19 16:28:28 +03:00
Rajeh Taher feb8a50065 readme: update NPM badge 2025-08-19 16:25:22 +03:00
Rajeh Taher 6e2c52e1ab readme: Update discord ljnk 2025-08-19 16:24:01 +03:00
vini 162ebe1cc2 ci: build workflow (#1681) 2025-08-07 01:52:56 +03:00
João Lucas de Oliveira Lopes 812e53e4eb Refactor: Fix Event Buffer Deadlock with State Machine (#1633)
* feat: implement state machine for chat synchronization and buffer management

* test: Add Jest configuration and tests for connection deadlock handling

- Created a Jest configuration file to set up testing environment.
- Implemented utility functions for creating isolated authentication sessions and mocking WebSocket connections.
- Added a test case to ensure that the connection does not deadlock when history sync is disabled, verifying the correct handling of message events.

* feat: add GitHub Actions workflow for running tests

* chore: sort import lint

* fix: implement timeout handling for AwaitingInitialSync state in chat socket, maybe fix memory leak

* feat: enhance chat synchronization by refining AwaitingInitialSync handling and adding history sync checks
2025-08-07 01:15:41 +03:00