Skip to content

Commit

Permalink
fix: avoid zalgo when calling down to publish messages (#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
feywind authored Apr 26, 2023
1 parent 2b90f2c commit dedae1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/publisher/message-queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export abstract class MessageQueue extends EventEmitter {
};
if (messages.length === 0) {
if (typeof callback === 'function') {
callback(null);
// Do this on the next tick to avoid Zalgo with the publish request below.
process.nextTick(() => callback(null));
}
return;
}
Expand Down

0 comments on commit dedae1e

Please sign in to comment.