Skip to content

fix: clean up token refresh listeners#199

Open
saurabhhhcodes wants to merge 1 commit into
ThePlator:mainfrom
saurabhhhcodes:fix/token-refresh-listener-cleanup-196
Open

fix: clean up token refresh listeners#199
saurabhhhcodes wants to merge 1 commit into
ThePlator:mainfrom
saurabhhhcodes:fix/token-refresh-listener-cleanup-196

Conversation

@saurabhhhcodes

Copy link
Copy Markdown

Summary

  • make addTokenRefreshListener return an unsubscribe cleanup function
  • remove the active MessageContext token-refresh listener when its socket lifecycle ends
  • prevent remount/login cycles from accumulating duplicate socket reconnect callbacks

Closes #196

Validation

  • npm install --ignore-scripts in frontend
  • git diff --check

Notes

  • npm run build and npx tsc --noEmit currently reach pre-existing type errors unrelated to this listener cleanup: optional currentUser.id in MessageContext, markAllAsSeen returning void, and ChatSidebar selectedUser missing unread. I left those broader typing fixes out to keep this PR focused on the listener leak.

@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Sameer's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc:approved Approved for GirlScript Summer of Code level:beginner Beginner level difficulty quality:clean Clean code quality type:bug Bug fix labels May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GirlScript Summer of Code level:beginner Beginner level difficulty quality:clean Clean code quality type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent duplicate socket reconnects caused by accumulated token refresh listeners

1 participant