Closed MaximumADHD closed 4 years ago
Your branch seems to have an error in AeroClient on line 187.
service[methodName] = function (self, ...)
local now = tick()
if (fetchingPromise) then
local _,c = fetchingPromise:Await()
return table.unpack(c)
elseif (cache == NO_CACHE or (cacheTTL > 0 and (now - lastCacheTime) > cacheTTL)) then
lastCacheTime = now
local args = table.pack(...)
fetchingPromise = Promise.Async(function (resolve, reject)
resolve(table.pack(v:InvokeServer(table.unpack(args))))
end)
local success, _cache = fetchingPromise:Await()
if (success) then
cache = _cache
end
fetchingPromise = nil
return table.unpack(_cache)
end
return table.unpack(cache)
else
service[v.Name] = function (self, ...)
return v:InvokeServer(...)
end
end
It seems like you may have intended to do this:
service[methodName] = function (self, ...)
local now = tick()
if (fetchingPromise) then
local _,c = fetchingPromise:Await()
return table.unpack(c)
elseif (cache == NO_CACHE or (cacheTTL > 0 and (now - lastCacheTime) > cacheTTL)) then
lastCacheTime = now
local args = table.pack(...)
fetchingPromise = Promise.Async(function (resolve, reject)
resolve(table.pack(v:InvokeServer(table.unpack(args))))
end)
local success, _cache = fetchingPromise:Await()
if (success) then
cache = _cache
end
fetchingPromise = nil
return table.unpack(_cache)
else
service[v.Name] = function (self, ...)
return v:InvokeServer(...)
end
end
end
I'm gonna close this for now since v1.7.0 is going to cause a lot of conflicts with this. We can revisit these features a bit later though.
This commit introduces some features that I added to my internal fork of Aero in Crown Academy. I also made some minor style tweaks to the code for broader readability.
I expect this to have a few rounds of feedback before it gets merged, so let me know what you think :)