wechaty / friday

Friday is an Assistant BOT Built on Wechaty for Serving our Community
http://friday.chatie.io:5200
Apache License 2.0
83 stars 20 forks source link

Move `isDuplicatedMessage` from Event Handler Class to Saga #116

Open huan opened 2 years ago

huan commented 2 years ago

I think the Event Handler Class will be instantiated from time to time when there's a new event, and will not keep/reuse the class instance for the next one.

So the isDuplicatedMessage will always forget the hash it calculated last time.

https://github.com/wechaty/friday/blob/8338c8e718a7dc0e271a9cd80c8f96a8ab918449/src/core/sync-community-rooms/events/handlers/puppet-message-received.handler.ts#L103-L130

Should move to Saga.