From 1f52229775ac654aaf4e1807b38a4bc1527a1434 Mon Sep 17 00:00:00 2001 From: sostler Date: Thu, 27 May 2010 19:01:01 -0400 Subject: Fixed disappearing messages bug --- static/tests/bugchat.html | 2 +- static/tests/bugchat.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'static') diff --git a/static/tests/bugchat.html b/static/tests/bugchat.html index 548eb6d..bcfacc4 100644 --- a/static/tests/bugchat.html +++ b/static/tests/bugchat.html @@ -2,7 +2,7 @@ BUG CHAT - + diff --git a/static/tests/bugchat.js b/static/tests/bugchat.js index 5d9a7b5..eba3177 100644 --- a/static/tests/bugchat.js +++ b/static/tests/bugchat.js @@ -56,7 +56,7 @@ function showError(err) { }; -function handleMessages(msgs) { +function handleMessages(msgs, oldTime, newTime) { $.map(msgs, function(m) { var split = m.content.split("-"); if (split.length != 2) { @@ -71,7 +71,9 @@ function handleMessages(msgs) { var p = ClientMap[client]; if (i - p != 1) { showError("[" + Key + "] Error for client " + client - + "! Expected " + (p+1) + ", got " + i); + + "! Expected " + (p+1) + ", got " + i + + " (" + oldTime + " -> " + newTime + ")" + ); } } ClientMap[client] = i; @@ -81,8 +83,8 @@ function handleMessages(msgs) { function refresh() { var onSuccess = function(json) { try { + handleMessages(json.messages, Timestamp, json.timestamp); Timestamp = json.timestamp; - handleMessages(json.messages); } catch(e) { console.error(e); $('#msgs').append($('
').css('color', 'red').text(e)); -- cgit v1.2.3-70-g09d2