Details

    • Branch Version/s:
      6.2.x, 6.1.x
    • Backported to Branch:
      Committed
    • Story Points:
      4
    • Fix Priority:
      4
    • Similar Issues:
      Show 5 results 

      Description

      While two users are chatting, the received message display time in chat box sometimes exceeds the current system time.

      Steps to reproduce :
      1) Deploy chat portlet into portal
      2) Create 2 users - user1 and user2
      3) Open 2 browsers and log in with each of them
      4) Start chatting

      Actual Behavior:
      Sometimes we'll see the received message display time exceeds the current system time (See attached screenshot, you also see the seconds is because I did that for debugging)
      PS : The issue is easier to replicate while sending message by the end of a minute

      Expected Behavior:
      The message display time should not exceed current system time, it shows the current time at most

      The root cause is that when a user logs in and starts a chat, an offset will be calculated and set. This offset can be several seconds to even minutes.

      _getOffset: function() {
      	var instance = this;
      
      	var offset = instance._offset;
      
      	if (Lang.isUndefined(offset)) {
      		var currentChatServerTime = A.one('#currentChatServerTime').val() || now();
      
      		offset = now() - currentChatServerTime;
      
      		instance._offset = offset;
      	}
      
      	return offset;
      },
      

      When converting to client timestamp, the display time is added by the offset. Sometimes this could exceed current system time.

      _convertToClientTimestamp: function(time) {
      	var instance = this;
      
      	time = Number(time);
      
      	time += instance._getOffset();
      
      	return time;
      },
      
      1. chat.png
        9 kB
      2. messedTime.png
        14 kB

        Issue Links

          Activity

          Hide
          Hugo Huijser added a comment -

          From Michael Chen:

          From what I see from the code in main.js, the offset should be a response time(time difference) between chat server and client browser that being calculated.
          The offset(server considers this as the delay between server and client) will be added to current chat server time, and then it'll be passed to client browser to display as message time.
          The issue is that sometimes this message display time exceeds the client's current system time, which is unreasonable.

          Show
          Hugo Huijser added a comment - From Michael Chen: From what I see from the code in main.js, the offset should be a response time(time difference) between chat server and client browser that being calculated. The offset(server considers this as the delay between server and client) will be added to current chat server time, and then it'll be passed to client browser to display as message time. The issue is that sometimes this message display time exceeds the client's current system time, which is unreasonable.
          Hide
          Lu Liu added a comment -

          Blocked by LPS-42508, can't add a chat portlet to page.

          Show
          Lu Liu added a comment - Blocked by LPS-42508 , can't add a chat portlet to page.
          Hide
          Lu Liu added a comment - - edited

          PASSED Manual Testing following the steps in the description.

          Reproduced on:
          Tomcat 7.0.42 + MySQL 5.5.29. Portal master GIT ID: f6b2af52bf7044aa838f88ccfcead2be837a5c22.
          Plugins master GIT ID: 43288f99ac9593b5c2734da79ea42a8f654ba98d.

          The time displayed in the chat box exceeds the current system time sometimes.

          Fixed on:
          Tomcat 7.0.40 + MySQL 5.5.29. Portal 6.1.x EE GIT ID: 88cfa87840b269f3c9930ec5d323fef8cf34e5b9.
          Plugins Portal 6.1.x EE GIT ID: 4bc31b9aab476776c007f4616ecf5b2cacfa0cb0.
          Tomcat 7.0.42 + MySQL 5.5.29. Portal master GIT ID:a126696ad8ba143ec81da3a8505eaa4aaca9881d.
          Plugins master GIT ID: 9f2988a27811005615814c8f43185b7082b06c04.

          The time displayed in the chat box shows the current time.

          Show
          Lu Liu added a comment - - edited PASSED Manual Testing following the steps in the description. Reproduced on: Tomcat 7.0.42 + MySQL 5.5.29. Portal master GIT ID: f6b2af52bf7044aa838f88ccfcead2be837a5c22. Plugins master GIT ID: 43288f99ac9593b5c2734da79ea42a8f654ba98d. The time displayed in the chat box exceeds the current system time sometimes. Fixed on: Tomcat 7.0.40 + MySQL 5.5.29. Portal 6.1.x EE GIT ID: 88cfa87840b269f3c9930ec5d323fef8cf34e5b9. Plugins Portal 6.1.x EE GIT ID: 4bc31b9aab476776c007f4616ecf5b2cacfa0cb0. Tomcat 7.0.42 + MySQL 5.5.29. Portal master GIT ID:a126696ad8ba143ec81da3a8505eaa4aaca9881d. Plugins master GIT ID: 9f2988a27811005615814c8f43185b7082b06c04. The time displayed in the chat box shows the current time.
          Hide
          Joseph Chin added a comment - - edited

          PASSED Manual Testing following the steps in the description.

          Fixed on:
          Tomcat 7.0.42 + MySQL 5.5. Portal 6.2.0 CE GA1.
          Plugins 6.2.x GIT ID: f2037ddb7e3b2d357ef2ed676d3537dcf9b9d52f.
          Tomcat 7.0.42 + MySQL 5.5. Portal 6.2.10 EE GA1.
          Plugins ee-6.2.10 GIT ID: d8a7e697e776b53d59ef49c52f0ef3324c54a2a2.

          The time displayed in the chat box shows the current time.

          Show
          Joseph Chin added a comment - - edited PASSED Manual Testing following the steps in the description. Fixed on: Tomcat 7.0.42 + MySQL 5.5. Portal 6.2.0 CE GA1. Plugins 6.2.x GIT ID: f2037ddb7e3b2d357ef2ed676d3537dcf9b9d52f. Tomcat 7.0.42 + MySQL 5.5. Portal 6.2.10 EE GA1. Plugins ee-6.2.10 GIT ID: d8a7e697e776b53d59ef49c52f0ef3324c54a2a2. The time displayed in the chat box shows the current time.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 33 weeks, 1 day ago

                Development

                  Subcomponents

                    Structure Helper Panel