fix: streamline JID handling by removing redundant checks and acknowledgments#2352
Open
fix: streamline JID handling by removing redundant checks and acknowledgments#2352
Conversation
Contributor
|
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. |
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.
Moves the shouldIgnoreJid check from inside each handler (handleMessage, handleReceipt, handleNotification) up into processNode so ignored JIDs are acked and dropped before entering the event buffer or offline queue.
Previously every ignored message still went through the full ev.buffer()/ev.flush() cycle and handler invocation just to be discarded. In setups with many sessions in a single process this added thousands of unnecessary buffer cycles for group/broadcast messages during history sync.
Messages still get a proper ack (error 500 for messages, clean ack for receipts/notifications) matching the original behavior. Calls are excluded since they don't use shouldIgnoreJid.