From 78991c7e82bdc5a6c4a3f5ed74dc643e96b7c69f Mon Sep 17 00:00:00 2001 From: kennethloeffler Date: Sun, 3 May 2026 15:11:20 -0700 Subject: [PATCH] Use lossy conversion for UInt64 decode in plugin --- plugin/http/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/http/init.lua b/plugin/http/init.lua index 106ebc45..c72c2066 100644 --- a/plugin/http/init.lua +++ b/plugin/http/init.lua @@ -14,6 +14,13 @@ local Http = {} Http.Error = HttpError Http.Response = HttpResponse +-- Monkey patch msgpack.UInt64.new to lossily convert the low and high bits of the integer +-- to a native Luau number. We should change the upstream decoder to emit a native +-- integer, once those are live. +function msgpack.UInt64.new(mostSignificantPart: number, leastSignificantPart: number): number + return mostSignificantPart * 2 ^ 32 + (leastSignificantPart % 2 ^ 32) +end + local function performRequest(requestParams) local requestId = lastRequestId + 1 lastRequestId = requestId