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
- 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
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
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.
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.
* 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
* chore: Changed name for release
* chore: Sorted package.json
* ci: Added workflow to publish releases
* chore: Updated .gitignore
* chore: Updated lint to use nodejs v18
* chore: Updated package name in README.md
* chore: Change the current version