diff --git a/services/web/app/coffee/Features/Compile/ClsiCookieManager.coffee b/services/web/app/coffee/Features/Compile/ClsiCookieManager.coffee index 4e02469f0a..18e69e274d 100644 --- a/services/web/app/coffee/Features/Compile/ClsiCookieManager.coffee +++ b/services/web/app/coffee/Features/Compile/ClsiCookieManager.coffee @@ -19,10 +19,10 @@ module.exports = ClsiCookieManager = rclient.get buildKey(project_id), (err, serverId)-> if err? return callback(err) - if serverId? - return callback(null, serverId) - else + if !serverId? or serverId == "" return ClsiCookieManager._populateServerIdViaRequest project_id, callback + else + return callback(null, serverId) _populateServerIdViaRequest :(project_id, callback = (err, serverId)->)-> diff --git a/services/web/test/UnitTests/coffee/Compile/ClsiCookieManagerTests.coffee b/services/web/test/UnitTests/coffee/Compile/ClsiCookieManagerTests.coffee index 9e60d8bde7..ae0e9eb20e 100644 --- a/services/web/test/UnitTests/coffee/Compile/ClsiCookieManagerTests.coffee +++ b/services/web/test/UnitTests/coffee/Compile/ClsiCookieManagerTests.coffee @@ -60,6 +60,13 @@ describe "ClsiCookieManager", -> @ClsiCookieManager._populateServerIdViaRequest.calledWith(@project_id).should.equal true done() + it "should _populateServerIdViaRequest if no key is blank", (done)-> + @ClsiCookieManager._populateServerIdViaRequest = sinon.stub().callsArgWith(1) + @redis.get.callsArgWith(1, null, "") + @ClsiCookieManager._getServerId @project_id, (err, serverId)=> + @ClsiCookieManager._populateServerIdViaRequest.calledWith(@project_id).should.equal true + done() + describe "_populateServerIdViaRequest", ->