Skip to content

Conversation

@vinikjkkj
Copy link
Collaborator

Added registerSocketEndHandler to register cleanup callbacks that run when socket closes. Implemented cleanup in:

  • Signal repository: clear migrated session cache and LID mapping
  • Chats socket: clear sync timeout and placeholder resend cache
  • Messages recv: clear retry/call offer/placeholder caches and identity assert debounce
  • Messages send: clear user devices/peer sessions caches and media connection
  • Event buffer: add destroy

@whiskeysockets-bot
Copy link
Contributor

whiskeysockets-bot commented Dec 16, 2025

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 works

If you’ve tested this PR, please comment below with:

Tested and working ✅

This helps us speed up the review and merge process.

📦 To test this PR locally:

# NPM
npm install @whiskeysockets/baileys@WhiskeySockets/Baileys#end-handlers

# Yarn (v2+)
yarn add @whiskeysockets/baileys@WhiskeySockets/Baileys#end-handlers

# PNPM
pnpm add @whiskeysockets/baileys@WhiskeySockets/Baileys#end-handlers

If you encounter any issues or have feedback, feel free to comment as well.

Added `registerSocketEndHandler` to register cleanup callbacks that run when socket closes. Implemented cleanup in:
- Signal repository: clear migrated session cache and LID mapping
- Chats socket: clear sync timeout and placeholder resend cache
- Messages recv: clear retry/call offer/placeholder caches and identity assert debounce
- Messages send: clear user devices/peer sessions caches and media connection
- Event buffer: add destroy
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the Stale label Dec 31, 2025
@vinikjkkj vinikjkkj removed the Stale label Jan 2, 2026
Copy link
Member

@purpshell purpshell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlucaso1 let's do a destructive benchmark test on bartender by returning a server close error in the middle of a benchmark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants