configurePingInterval does not properly check if there's an active pingIntervalId #2739

Closed
NTaylorMullen opened this Issue Dec 4, 2013 · 1 comment

Comments

Projects
None yet
3 participants
Contributor

NTaylorMullen commented Dec 4, 2013

Currently it checks an undefined value to determine that a pingIntervalId is not set, therefore it's "always" set. It must be changed to look at the appropriate variable.

AKA:
(current)

configurePingInterval = function (connection) {
            var config = connection._.config,
                onFail = function (error) {
                    $(connection).triggerHandler(events.onError, [error]);
                };

            if (!config.pingIntervalId && config.pingInterval) {
                connection._.pingIntervalId = window.setInterval(function () {
                    signalR.transports._logic.pingServer(connection).fail(onFail);
                }, config.pingInterval);
            }
        },

TO

configurePingInterval = function (connection) {
            var config = connection._.config,
                onFail = function (error) {
                    $(connection).triggerHandler(events.onError, [error]);
                };

            if (!connection._.pingIntervalId && config.pingInterval) {
                connection._.pingIntervalId = window.setInterval(function () {
                    signalR.transports._logic.pingServer(connection).fail(onFail);
                }, config.pingInterval);
            }
        },

abnanda1 was assigned Dec 4, 2013

@abnanda1 abnanda1 added a commit that referenced this issue Jan 2, 2014

@abnanda1 abnanda1 #2739 0af0667

@abnanda1 abnanda1 added a commit that referenced this issue Jan 3, 2014

@abnanda1 abnanda1 #2739 98aeb6b
Contributor

gustavo-armenta commented Jan 9, 2014

tested connection._.pingIntervalId is initialized once, deleted when connection is stopped, and re-initialized when connection is started

@abnanda1 abnanda1 added a commit that referenced this issue Jan 21, 2014

@abnanda1 @halter73 abnanda1 + halter73 #2739 7b4dd40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment