Fossil SCM
Squelch /chat poll timeout errors in the dev console unless an internal debugging flag is enabled. They're an expected error case and generate lots of console log entries.
Commit
1eddedeaecdfb0f0f4b0287bc26fe32c9fad183c653fb3cb09a91f1f87fa7879
Parent
641a02c8f3f89f4…
1 file changed
+6
-4
+6
-4
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -94,10 +94,12 @@ | ||
| 94 | 94 | return resized; |
| 95 | 95 | })(); |
| 96 | 96 | fossil.FRK = ForceResizeKludge/*for debugging*/; |
| 97 | 97 | const Chat = (function(){ |
| 98 | 98 | const cs = { |
| 99 | + verboseErrors: false /* if true then certain, mostly extraneous, | |
| 100 | + error messages may be sent to the console. */, | |
| 99 | 101 | e:{/*map of certain DOM elements.*/ |
| 100 | 102 | messageInjectPoint: E1('#message-inject-point'), |
| 101 | 103 | pageTitle: E1('head title'), |
| 102 | 104 | loadOlderToolbar: undefined /* the load-posts toolbar (dynamically created) */, |
| 103 | 105 | inputWrapper: E1("#chat-input-area"), |
| @@ -226,13 +228,13 @@ | ||
| 226 | 228 | }else{ |
| 227 | 229 | eMsg.scrollIntoView(false); |
| 228 | 230 | } |
| 229 | 231 | return this; |
| 230 | 232 | }, |
| 231 | - /* Injects element e as a new row in the chat, at the oldest end | |
| 232 | - of the list if atEnd is truthy, else at the newest end of the | |
| 233 | - list. */ | |
| 233 | + /* Injects DOM element e as a new row in the chat, at the oldest | |
| 234 | + end of the list if atEnd is truthy, else at the newest end of | |
| 235 | + the list. */ | |
| 234 | 236 | injectMessageElem: function f(e, atEnd){ |
| 235 | 237 | const mip = atEnd ? this.e.loadOlderToolbar : this.e.messageInjectPoint, |
| 236 | 238 | holder = this.e.messagesWrapper, |
| 237 | 239 | prevMessage = this.e.newestMessage; |
| 238 | 240 | if(atEnd){ |
| @@ -1229,11 +1231,11 @@ | ||
| 1229 | 1231 | // Disable the ajax start/end handling for this long-polling op: |
| 1230 | 1232 | beforesend: function(){}, |
| 1231 | 1233 | aftersend: function(){}, |
| 1232 | 1234 | onerror:function(err){ |
| 1233 | 1235 | Chat._isBatchLoading = false; |
| 1234 | - console.error(err); | |
| 1236 | + if(Chat.verboseErrors) console.error(err); | |
| 1235 | 1237 | /* ^^^ we don't use Chat.reportError() here b/c the polling |
| 1236 | 1238 | fails exepectedly when it times out, but is then immediately |
| 1237 | 1239 | resumed, and reportError() produces a loud error message. */ |
| 1238 | 1240 | afterFetch(); |
| 1239 | 1241 | }, |
| 1240 | 1242 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -94,10 +94,12 @@ | |
| 94 | return resized; |
| 95 | })(); |
| 96 | fossil.FRK = ForceResizeKludge/*for debugging*/; |
| 97 | const Chat = (function(){ |
| 98 | const cs = { |
| 99 | e:{/*map of certain DOM elements.*/ |
| 100 | messageInjectPoint: E1('#message-inject-point'), |
| 101 | pageTitle: E1('head title'), |
| 102 | loadOlderToolbar: undefined /* the load-posts toolbar (dynamically created) */, |
| 103 | inputWrapper: E1("#chat-input-area"), |
| @@ -226,13 +228,13 @@ | |
| 226 | }else{ |
| 227 | eMsg.scrollIntoView(false); |
| 228 | } |
| 229 | return this; |
| 230 | }, |
| 231 | /* Injects element e as a new row in the chat, at the oldest end |
| 232 | of the list if atEnd is truthy, else at the newest end of the |
| 233 | list. */ |
| 234 | injectMessageElem: function f(e, atEnd){ |
| 235 | const mip = atEnd ? this.e.loadOlderToolbar : this.e.messageInjectPoint, |
| 236 | holder = this.e.messagesWrapper, |
| 237 | prevMessage = this.e.newestMessage; |
| 238 | if(atEnd){ |
| @@ -1229,11 +1231,11 @@ | |
| 1229 | // Disable the ajax start/end handling for this long-polling op: |
| 1230 | beforesend: function(){}, |
| 1231 | aftersend: function(){}, |
| 1232 | onerror:function(err){ |
| 1233 | Chat._isBatchLoading = false; |
| 1234 | console.error(err); |
| 1235 | /* ^^^ we don't use Chat.reportError() here b/c the polling |
| 1236 | fails exepectedly when it times out, but is then immediately |
| 1237 | resumed, and reportError() produces a loud error message. */ |
| 1238 | afterFetch(); |
| 1239 | }, |
| 1240 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -94,10 +94,12 @@ | |
| 94 | return resized; |
| 95 | })(); |
| 96 | fossil.FRK = ForceResizeKludge/*for debugging*/; |
| 97 | const Chat = (function(){ |
| 98 | const cs = { |
| 99 | verboseErrors: false /* if true then certain, mostly extraneous, |
| 100 | error messages may be sent to the console. */, |
| 101 | e:{/*map of certain DOM elements.*/ |
| 102 | messageInjectPoint: E1('#message-inject-point'), |
| 103 | pageTitle: E1('head title'), |
| 104 | loadOlderToolbar: undefined /* the load-posts toolbar (dynamically created) */, |
| 105 | inputWrapper: E1("#chat-input-area"), |
| @@ -226,13 +228,13 @@ | |
| 228 | }else{ |
| 229 | eMsg.scrollIntoView(false); |
| 230 | } |
| 231 | return this; |
| 232 | }, |
| 233 | /* Injects DOM element e as a new row in the chat, at the oldest |
| 234 | end of the list if atEnd is truthy, else at the newest end of |
| 235 | the list. */ |
| 236 | injectMessageElem: function f(e, atEnd){ |
| 237 | const mip = atEnd ? this.e.loadOlderToolbar : this.e.messageInjectPoint, |
| 238 | holder = this.e.messagesWrapper, |
| 239 | prevMessage = this.e.newestMessage; |
| 240 | if(atEnd){ |
| @@ -1229,11 +1231,11 @@ | |
| 1231 | // Disable the ajax start/end handling for this long-polling op: |
| 1232 | beforesend: function(){}, |
| 1233 | aftersend: function(){}, |
| 1234 | onerror:function(err){ |
| 1235 | Chat._isBatchLoading = false; |
| 1236 | if(Chat.verboseErrors) console.error(err); |
| 1237 | /* ^^^ we don't use Chat.reportError() here b/c the polling |
| 1238 | fails exepectedly when it times out, but is then immediately |
| 1239 | resumed, and reportError() produces a loud error message. */ |
| 1240 | afterFetch(); |
| 1241 | }, |
| 1242 |