Real-time Streaming - not sure if my nodebb installation is working



  • Hi,

    I'm not sure if my nodebb is working normally. How fast is real-time streaming supposed to be? Can I make it faster? like updates every 1-2 seconds?

    I saw this on the nodebb home page

    Real-time Streaming - Interact with your userbase faster than ever before with instant notifications, streaming posts, and real-time chats.


  • Global Moderator

    @noobbb it should update immediately. However, I believe the connection is shut down after a certain amount of inactivity.



  • @PitaJ Ahh I see. Is there anything I can do to keep the connection alive or make it reconnect faster?


  • Admin

    Here is a really dirty hack. You can put it in your custom JS section in the ACP

    var refreshTimeoutId = 0;
    $(window).on('action:ajaxify.end', function () {
            if (!app.user.uid) {
                 return;
            }
    	if (refreshTimeoutId) {
    		clearTimeout(refreshTimeoutId);
    	}
    	refreshTimeoutId = setTimeout(ajaxify.refresh, 300000);
    });
    

    This will cause the page to refresh after 5 mins of inactivity hence marking the user online again, after that they should keep receiving realtime notifications.



  • @baris Thank you for this.



  • @noobbb I added the code to acp > appearance > custom html/css > custom header

    then I restarted nodebb

    I used a guest account to reply. The other account, which I am logged in with, always immediately gets a notification sound and message box at the bottom right so that's working perfectly. However, the message/post itself usually does not appear until I refresh the page. It does appear sometimes - usually if I have waited a while to reply first - seems like a cool down period is required? If I rapid fire a bunch of replies, they won't live stream.

    Can I make it always live stream? Thanks.


  • Admin

    We don't have a cooldown for the instant replies, they should show up if you are at the bottom of the topic.



  • @baris Hmm. What options do I have to make real time streaming work? Do I need to reinstall nodebb?


  • Global Moderator

    @noobbb open a bug on Github and we'll see if we can reproduce the issue. If it's not streaming posts, it's a bug.



  • @PitaJ Will do. Thanks.



  • So, I tried opening a bug on github, but the devs couldn't replicate the issue on their end. Would anyone be able to point me in the right direction? eg the code that is responsible to making new replies "live stream"? I found a few candidates to investigate

    but I'm not sure if I'm on the right track. Thank you.


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.