posts.getUpvoters - socket.io flood - user emit banned

NodeBB Plugins
  • Hmm actually that message only shows the last emit, so the 19 before it could be any emit calls, I'll change the code so it keeps track of the previous 20 events to debug further.

  • Try updating to https://github.com/NodeBB/NodeBB/commit/aab2bc0b3923630c4d18ec8edc5ee7437e9e9917 and post the log when you get that too many emits warning.

  • @baris I have this one for now

    21/1 14:13 [30334] - warn: [socket.io] Too many emits! Disconnecting uid : 49. Events : meta.reconnected,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.notifyTyping,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.notifyTyping,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.notifyTyping,modules.composer.renderPreview,modules.composer.renderPreview,modules.composer.notifyTyping,modules.composer.renderPreview,user.search,modules.composer.renderPreview
    

    There's a least 3 users with the bug I'll update when I catch more.

  • Thanks looks like that user disconnected and then sent a bunch of render preview calls.

    meta.reconnected,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.notifyTyping,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.notifyTyping,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.notifyTyping,
    modules.composer.renderPreview,
    modules.composer.renderPreview,
    modules.composer.notifyTyping,
    modules.composer.renderPreview,
    user.search,
    modules.composer.renderPreview
    
  • @baris Here's the user of yesterday

    21/1 14:54 [30334] - warn: Flooding detected! Calls : 21, Duration : 959
    21/1 14:54 [30334] - warn: [socket.io] Too many emits! Disconnecting uid : 2. Events : topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead,topics.loadMore,topics.markAsRead
    
    
  • @baris

    socket.emit('posts.getUpvoters', [1,2,3,4], function(err, data){
        console.log(data);
    });
    

    Is not working when there's more than one post in the array. The data.usernames object is empty.
    And I'm sure that the posts have votes because I construct the array testing if the votes attribute is equal to 0 or not.

    Another question is there any avaible hook to fire my function when posts are loading inside a topic (infinite scroll). I've tested action:topic.loading and action:ajaxify.end but both gets only fired once.

    As for the logs of my uid 2 any idea on what's happening ?
    Thanks in advance.

  • Try with https://github.com/NodeBB/NodeBB/commit/835ad3ea537e80baad35e90b6b438b037f03cfa4

    Still haven't figured out why flooding is triggered for some users.

  • @baris Thanks the posts.getUpvoters is fixed 😉
    Any idea on how to fire the function when new posts are loaded while scrolling ? I think some http://api.jquery.com/ajaxcomplete/ could do the trick but it's kind of ugly no ?
    Also havin a hook that gives back the pids of the logged posts could be even more nice would avoid to do the ones already done.

  • The hook that's fired when new posts are loaded is action:posts.loaded I can add the pids to this hook which should help in this case.

  • You will get the loaded pids in the params of the hook with that commit.


Suggested Topics