Skip to content

Commit

Permalink
Add additional crunch for race condition bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexx384 committed Jul 2, 2024
1 parent 78e1e3d commit 983bcb4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/telegram/messageHandler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export class MessageHandlerService {
} else if (update.update.message.hasOwnProperty('migrate_from_chat_id')) {
// It could be also the case for race condition
this.logger.log('Recieved migrate_from_chat_id message');
return;
} else if (update.update.message.hasOwnProperty('new_chat_participant')) {
// Presumably this kind of message is causing race condition and two records using findOneAndUpdate and updateOne with upsert are created
this.logger.log('Recieve new_chat_participant message');
return;
} else if (update.chat.type === 'private') {
this.logger.log('Skipping processing because chat type is private');
return;
Expand Down

0 comments on commit 983bcb4

Please sign in to comment.