PubNub Live Chat Beta Testing

Dear All,

We are now beta testing our future "Live Chat" area using PubNub technology.

https://www.unix.com/usercp/#/livechat

This purpose of this testing is to test the core system, in general, and to see how many, if any, bugs crawl out of the woodwork.

This "Live Chat" is not the final version, just testing live. In the future, when the kinks are working out, we may include something similar to this embedded in each thread (Ravinder's idea). Ravinder has a lot of ideas on features to add to modernize the site, so let's see how this one goes!

We are not fixed or sure on how to incorporate this kind of live chat and peer-to-peer messaging into the site; but it's good to live test the basic PubNub infrastructure we are currently using for publish-subscribe messaging.

Just have fun and enjoy.

2 Likes

FYI,

When I get the bugs in the PHP SDK worked out, will start adding channels from the main forums for alerts. The channel subscriptions will have easy to join and leave checkboxes, like in this mockup:

Mockup with channel selectors on the bottom:

neo over there pouring his heart and soul into this. Who knows... this might be a goldmine of knowledge decades from now.

1 Like

Times they are a chang'in - Bob Dylan

Today the server can send messages (and eventually receive) messages from user browsers thanks to some much appreciated technical support from PubNub.

Here is the first successful test message from the server, completed just now:

1 Like

OK... when a new discussion thread is created, the server now posts a message to Live Chat:

I will more than likely expand this for all post replies as well.

OK... I think "new discussion" and "replies" are now posted in Live Chat.

Later, I will put this info on a different channel than chat and add a channel selector. For now, I'll keep in all in the same channel during live testing.

Examples of Live Chat testing and new user support today:

OK. Cool.

Have added the logic for two very basic channel filters, (1) Live and (2) Posts.

These are not "channel selectors" per se because the channel is the same as far as our PubNub channel IDs are concerned, but the checkboxes will filter new messages when live (after the page has been initialized).

These filters will clear when the Live Chat page is initialized. This is by design while testing. In the future, I may add logic to save the check box preferences and have them load when the is initialized. But for now, I think best to test like this.

The only use case (for me) is to turn off the forum posts messages when in a busy Live Chat; but it's really not a problem (so far) but it might be when this new LC gets very busy in the future. My other possible use case would be if I was only interested monitoring forum posts updates and did not want to read the live chat messages; but I doubt I would ever filter these out as that's the part I enjoy the most so far.

UserCP Screeching Frog 0.7559

1 Like

UserCP Screeching Frog 0.7562

  • Added new channel filter for "status message". (filtered by default, must be selected to see)
  • Created "new member activated" status message (currently debugging).

I may consider adding cybersecurity alerts for admins and site developers as status message, but not this week.

UserCP Screeching Frog 0.7563

  • Further refined the "forum status" channel filter.

UserCP Screeching Frog 0.7564

  • Fixed small bug I created in version 0.7563 working on "status" message filtering.

I was considering which status messages to send on this channel.

But now I think best I create a new channel for most all system status messages and not send or filter these in the Live Chat window.

UserCP Screeching Frog 0.7565

  • Added storage hook to permit "status message" to be show on page initializations (default on, instead of default off).

Current version:

UserCP Screeching Frog 0.7572

  • Adds some new "behind the scenes" functionality and fixed some minor bugs.

Please clear your cache to insure you are running v0.7572

Soon, will change the channel filters to be "live filters", because I don't like how the channel filters are working.

Thanks.

UserCP Screeching Frog 0.7573

  • Reversed the order of the message list in the Live Chat UI. Now the newest message is at the bottom instead of the top.

There was or is a Safari bug (and may still be) where the scroll bar does not follow the updated messages exactly. When I test on Chome (and FF), it is fine, but on Safari, there is a small scroll bar error. That is the reason I reversed it before (and put the most recent messages on the bottom). I will add a switch so the user can choose the order of the list in the UI in a soon release.

UserCP SF version: 0.7574,

  • Change channel filters to work on live data in real time.

UserCP Screeching Frog 0.7575

  • Added checkbox to toggle the message list order in the UI, giving.
  • Used the same color above on the channel filter buttons.

UserCP Screeching Frog 0.7578

  • Changed live chat interval timers for updating user presence to two minutes to reduce network transactions.
  • Made all channel filters default "on" since they are working JS array live filters which do not require a page reload.

UserCP Screeching Frog 0.7579

  • Clear live chat interval timer for user presence when user leaves live chat (reduce network transactions).

UserCP Screeching Frog 0.7580

  • Get presence when message received.

UserCP Screeching Frog 0.7581

  • Get presence when message sent.

UserCP Screeching Frog 0.7582

  • Get presence when mounted before interval timer is set.

Please clear and reload your cache to version 0.7582 to help reduce network transactions (as save money). Thanks.

UserCP Screeching Frog 0.7583

  • Removed setInterval() for user presence and moved user presence method to updated() Vue.js lifecycle hook.
methods: {
    getHereNow() {
      var that = this;
      pubnub.hereNow(
        {
          channels: ["livechat"],
          includeUUIDs: true,
          includeState: true
        },
        function(status, response) {
          that.psoccupancy = response.totalOccupancy;
          var allusers = "";
          var index = 0;

          response.channels.livechat.occupants.forEach(function(user) {
            if (response.channels.livechat.occupants) {
              that.userarray.push(user);
              if (index == 0) allusers = user.uuid;
              else allusers = allusers + ", " + user.uuid;
            }
            index++;
            that.userlist = allusers;
          });
        }
      );
}

UserCP Screeching Frog 0.7584

  • Added 1 sec debounce() in updated() lifecycle hook for getHerNow() method.
 updated() {
    debounce(this.getHereNow, 1000);
  },

UserCP Screeching Frog 0.7585

  • Trigger debounce() on leading edge of debounce interval.
 updated() {
    debounce(this.getHereNow, 1000, true);
  },

UserCP Screeching Frog 0.7586

  • Trigger debounce() on trailing edge of debounce interval.
 updated() {
    debounce(this.getHereNow, 1000, false);
  },

UserCP Screeching Frog 0.7587

  • Trigger debounce() on leading edge of debounce interval (revert changes).
  • Remove getHereNow() from mounted() lifecycle hook.
 updated() {
    debounce(this.getHereNow, 1000, true);
  },

UserCP Screeching Frog 0.7589

  • Still tweaking this.getHereNow() in lifecycle hooks.

If the debouncing is working "good enough" and the unnecessary PubNub transactions are reduced without setInterval(), then we are good to go to build out a beta PM replacement on this live chat foundation on a per member basis.

UserCP Screeching Frog 0.7590

  • Added up and down indicator icon to the right of "Toggle Message Order".