CometD 3.1.6 Released

16 views
Skip to first unread message

Simone Bordet

unread,
Dec 20, 2018, 4:49:16 AM12/20/18
to cometd-users, cometd-dev
Hi,

CometD 3.1.6 has been released.

This is a minor bug fix release with a couple of important bug fixes.
The first is https://github.com/cometd/cometd/issues/699: browsers
have started to throttle the JavaScript scheduler in background tabs.
This means that if you have a CometD application

The list of fixes since 3.1.5.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.

Simone Bordet

unread,
Dec 20, 2018, 4:53:28 AM12/20/18
to cometd-users, cometd-dev
Hi,

CometD 3.1.6 has been released.

This is a minor bug fix release with a couple of important bug fixes.

The first is https://github.com/cometd/cometd/issues/699: browsers
have started to throttle the JavaScript scheduler in background tabs.
This means that if you have a CometD application in a background tab,
the CometD heartbeat will eventually stop (or be delayed to much by
the browser) that the server will expire sessions.
We have fixed this by using Web Workers and their scheduler, which is
not subject to throttling.
This required a bit of JavaScript magic, but hopefully all browsers support it.

The second is https://github.com/cometd/cometd/issues/809, better
support for HTTP/2: in some cases client errors were causing sessions
to be retained indefinitely by the server.

The list of fixes since 3.1.5:
https://github.com/cometd/cometd/milestone/15?closed=1

Enjoy!

steven winner

unread,
Dec 21, 2018, 9:25:59 AM12/21/18
to cometd-users
Simone,

Good timing for me to see a new release, since I'm moving our CometD service from one datacenter to another and have to make a few code changes anyways, so I'll let you know if anything comes up.  However, I am seeing a problem in the main cometd.js script involving the workers.

I am getting errors in the console (Chrome 71, MacOS) from a dynamically created "blob:"

Uncaught SyntaxError: Unexpected token }

I have traced that down to the web worker stuff in the _configure(configuration) function and the error goes away if you set the _config.useWorkerScheduler to false on cometd.js:1260.  Looks like it's trying to strip the beginning function declaration, open brace and the trailing brace, but it's removing more than it's intending from what I can see from my initial debugging/logging... Might be because I'm minifying the source code and it isn't expecting or wasn't tested like that?  

I'll report back if I find any issues with the serverside code

Thanks,
-Steve

Simone Bordet

unread,
Dec 21, 2018, 9:40:18 AM12/21/18
to cometd-users
Hi,

On Fri, Dec 21, 2018 at 3:26 PM steven winner <steven...@gmail.com> wrote:
>
> Simone,
>
> Good timing for me to see a new release, since I'm moving our CometD service from one datacenter to another and have to make a few code changes anyways, so I'll let you know if anything comes up. However, I am seeing a problem in the main cometd.js script involving the workers.
>
> I am getting errors in the console (Chrome 71, MacOS) from a dynamically created "blob:"
>
> Uncaught SyntaxError: Unexpected token }
>
> I have traced that down to the web worker stuff in the _configure(configuration) function and the error goes away if you set the _config.useWorkerScheduler to false on cometd.js:1260. Looks like it's trying to strip the beginning function declaration, open brace and the trailing brace, but it's removing more than it's intending from what I can see from my initial debugging/logging... Might be because I'm minifying the source code and it isn't expecting or wasn't tested like that?
>

It must be minification :(
Please file an issue about this.

steven winner

unread,
Dec 21, 2018, 9:41:02 AM12/21/18
to cometd-users
Simone,

Just wanted to report back that I believe it is because of the minifying.  I put it all back together (with it enabled) and didn't minify and the code it gets from that WorkerScheduler.toString() is multi line if not minified and is all one minified string with no line breaks if it was minified/uglified, so that regex for the code.replace should take that into account.

Relevant code from cometd.js:1466

            if (window.Worker && window.Blob && window.URL && _config.useWorkerScheduler) {
               
var code = WorkerScheduler.toString();
console
.log('workerScheduler toString() code before any processing: ', code);
               
// Remove the function declaration and the opening brace.
                code
= code.replace(/^function\s+.+{/, '');
               
// Remove the function's closing brace.
                code
= code.replace(/}\s*$/, '');
console
.log('code after processing to be used in new Blob object: ', code);

Reply all
Reply to author
Forward
0 new messages