<commit_before>var users = {};
var recentlyLeft = [];

module.exports = {
  subscribeUsers: function(req, res) {
    var params = req.allParams();
    var id = req.socket.id;
    req.socket.join('listeners');

    var username = params.username || 'Anonymous';
    users[id] = username;

    var index = recentlyLeft.indexOf(username);
    if (index === -1) {
      ChatService.addMachineMessage(users[id] + ' entered the room');
      emitListeners();
    } else {
      recentlyLeft.splice(index, 1);
    }

    req.socket.on('disconnect', function() {<commit_msg>Always emit listeners on new user connection<commit_after>var users = {};
var recentlyLeft = [];

module.exports = {
  subscribeUsers: function(req, res) {
    var params = req.allParams();
    var id = req.socket.id;
    req.socket.join('listeners');

    var username = params.username || 'Anonymous';
    users[id] = username;

    var index = recentlyLeft.indexOf(username);
    if (index === -1) {
      ChatService.addMachineMessage(users[id] + ' entered the room');
    } else {
      recentlyLeft.splice(index, 1);
    }
    emitListeners();

    req.socket.on('disconnect', function() {
{'fraction_non_alphanumeric': 0.14987080103359174, 'fraction_numerical': 0.0034453057708871662, 'mean_word_length': 3.2564102564102564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5427307', 'n_tokens_mistral': 360, 'n_tokens_neox': 350, 'n_words': 80}