-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: improve error handling and safe checking #1892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for opening this pull request and contributing to the project! The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch. In the meantime, anyone in the community is encouraged to test this pull request and provide feedback. ✅ How to confirm it worksIf you’ve tested this PR, please comment below with: This helps us speed up the review and merge process. 📦 To test this PR locally:If you encounter any issues or have feedback, feel free to comment as well. |
purpshell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks clean and makes sense, thanks.
Will need to test intensively before deployment.
|
Looking forward to testing |
7f1b30e to
7ff46ef
Compare
|
I've been testing this PR since it was released, it improved the issue of Messages waiting in groups in addition to stability improvements, I think it would be cool to merge it, it improves an annoying error that happens |
|
Tested and working ✅ |
7ff46ef to
1fbeb55
Compare
|
Tested and working ✅ |
… improve error logging in processMessage
1fbeb55 to
3aa9a92
Compare
|
It was just a merge notification to make my night 😂 |
…to chore-improve-some-type-safety
…to chore-improve-some-type-safety
…to chore-improve-some-type-safety
2d3f0bf to
4e41480
Compare
e7f531d to
8267146
Compare
|
This PR is stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 14 days |
…hecking - Add safe null/undefined checks throughout codebase - Improve error handling in message processing - Add defensive programming for edge cases - Improve type safety in message decoding 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Resolve conflicts and should merge |
…ets#1969 to latest Baileys Applied PRs: - WhiskeySockets#2067: libsignal wasm - WhiskeySockets#2057: emit setting events - WhiskeySockets#1969: improve retry logic Note: PRs WhiskeySockets#1991, WhiskeySockets#1981, WhiskeySockets#1906, WhiskeySockets#1892 have conflicts with latest Baileys version and were skipped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…fe null checks
…fe null checks
|
This PR is stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 14 days |
vinikjkkj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and working ✅
|
resolve conflicts! |
This PR is a continuation of #1891 ,but is more agressive too, so we need more tests to this changes
Implemented a
defer-likewithAckWrapper:withAckhigher-order function insrc/Socket/messages-recv.ts.try...finallyblock, guaranteeing that an acknowledgment (ack) is always sent to the server, even if the handler returns early or throws an error.handleReceipt,handleNotification, andhandleMessageto use this new pattern, eliminating scatteredackcalls and preventing bugs where anackmight be missed.Hardened Core Functions Against Null/Undefined Values:
messages-send.ts): Added a guard clause torelayMessageto check forauthState.creds.me.idbefore proceeding, preventing crashes if a message is sent before authentication is complete.decode-wa-message.ts): Replaced risky non-null assertions (!) on incoming message stanza attributes (id,from) with proper validation. The function now throws a descriptiveBoomerror if essential attributes are missing.process-message.ts): RefactoredgetChatIdto safely handle potentiallynullorundefinedremoteJidandparticipantvalues by using nullish coalescing (??), preventing crashes on malformed message keys.