Lua Script Cannot be Parsed after upgrading to 2.6.45 (original) (raw)

I've upgraded StackExchange.Redis nuget package to the latest version 2.6.45 and I've noticed that my previously working Lua script is no longer accepted at startup by Stack Exchange library. The exception thrown is

System.ArgumentException: Count not parse script: [...]
-------------------------------------------------------------------------------
-- API definitions
-------------------------------------------------------------------------------
local MessageStoreAPI = {}

MessageStoreAPI.confirmPendingDelivery = function(smscMessageId, smscDeliveredAt, smscMessageState)
    local messageId = redis.call('hget', "smId:" .. smscMessageId, 'mId')
    if not messageId then
        return nil
    end
    -- delete pending delivery
    redis.call('del', "smId:" .. smscMessageId)

    local mIdK = 'm:'..messageId

    local result = redis.call('hsetnx', mIdK, 'sState', smscMessageState)
    if result == 1 then
        redis.call('hset', mIdK, 'sDlvAt', smscDeliveredAt)
        redis.call('zrem', "msg.validUntil", messageId)
        return redis.call('hget', mIdK, 'payload')
    else
        return nil
    end
end


-------------------------------------------------------------------------------
-- Function lookup
-------------------------------------------------------------------------------

-- None of the function calls accept keys
if #KEYS > 0 then error('No Keys should be provided') end

-- The first argument must be the function that we intend to call, and it must
-- exist
local command_name = assert(table.remove(ARGV, 1), 'Must provide a command as first argument')
local command      = assert(MessageStoreAPI[command_name], 'Unknown command ' .. command_name)

return command(unpack(ARGV))

   at StackExchange.Redis.ScriptParameterMapper.PrepareScript(String script) in /_/src/StackExchange.Redis/ScriptParameterMapper.cs:line 145
   at StackExchange.Redis.LuaScript.Prepare(String script) in /_/src/StackExchange.Redis/LuaScript.cs:line 92

The very same script is working when using a previous version of StackExchange.Redis. Any hint on what's going on? The exception's message is not very helpful at pointing the error.