-
Notifications
You must be signed in to change notification settings - Fork 76
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
fix: thread manager bugs #1372
base: master
Are you sure you want to change the base?
fix: thread manager bugs #1372
Conversation
Size Change: +925 B (+0.22%) Total Size: 428 kB
|
src/thread_manager.ts
Outdated
@@ -117,6 +118,19 @@ export class ThreadManager<SCG extends ExtendableGenerics = DefaultGenerics> { | |||
return () => unsubscribeFunctions.forEach((unsubscribe) => unsubscribe()); | |||
}; | |||
|
|||
private subscribeChannelDeleted = () => { | |||
const unsubscribeFunctions = ['notification.channel_deleted', 'channel.deleted'].map((e) => { |
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.
const unsubscribeFunctions = ['notification.channel_deleted', 'channel.deleted'].map((e) => { | |
const unsubscribeFunctions = ['notification.channel_deleted'].map((e) => { |
One should suffice, notification-type events are always delivered - with less information - but in this case it's fine. With two in the array we're going to run the handler twice.
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.
Hey @arnautov-anton, notification events are not delivered for watched channels AFAIK. So we need to keep both.
CLA
Description of the changes, What, Why and How?
This PR fixes 2 leftover issues in Threads v2:
ThreadManager
state being stale after logging out in an appThreadManager
stateChangelog