Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
03fa16e
port compatible trader tool changes from pob1
vaisest Apr 18, 2026
654cf23
Fix corrupted mods being fractured mods in trade mod generation
vaisest Apr 19, 2026
d005f3e
Fix radius jewel weight generation
vaisest Apr 19, 2026
8d5d7aa
Regenerate QueryMods.lua
vaisest Apr 19, 2026
f3650d6
convert trade tool mod weight generation to use tradeHash
vaisest Apr 19, 2026
c99361d
wip: change poesessid to bearer token
vaisest Apr 19, 2026
05a0349
Cleanup: remove extra logout button and fix poeapi comments
vaisest Apr 20, 2026
adaed6e
Fix trader crash when rate limited on startup
vaisest Apr 20, 2026
307ffb2
Use https://poe.ninja/poe2/api/economy/exchange/current/overview for …
vaisest Apr 20, 2026
ab369ef
Fix poe.ninja tests
vaisest Apr 20, 2026
09b7e3c
Fix trader section anchor
vaisest Apr 20, 2026
b5f0852
Adjust price scaling factor due to things being in divs (still an abi…
vaisest Apr 20, 2026
5512994
Clarify price options and rate limit waits, and use Retry-After for r…
vaisest Apr 20, 2026
9f81706
rate limiting pls work
vaisest Apr 20, 2026
69ceb61
Fix perfect essences not appearing in generated weights, and regenera…
vaisest Apr 20, 2026
deb5c7c
Fix tradehashes for radius jewels
vaisest Apr 20, 2026
7cf398e
Improve rate limit countdown to prevent simplegraphic suspension prob…
vaisest Apr 21, 2026
105ad47
Fix debug print causing crash, and remove extra debug print
vaisest Apr 21, 2026
d818c69
disable wiping trader controls to fix crash when it is closed and a s…
vaisest Apr 21, 2026
53b411d
Add note about doing weird filter requirements (e.g. adorned)
vaisest Apr 21, 2026
e8f676c
remove whisper for instant buyout items
vaisest Apr 21, 2026
40bca91
make cspell happy
vaisest Apr 21, 2026
cb98f5b
Fix database radius jewels being nonfunctional
vaisest Apr 22, 2026
fdb052e
Fix currency conversion button not being updated after reopening trad…
vaisest Apr 23, 2026
8856622
Avoid useless search in "search for" button
vaisest Apr 23, 2026
536f2a6
fix api error on invalid token
vaisest Apr 24, 2026
4bda188
disable reuseaddr
vaisest Apr 25, 2026
332b22e
Rework OAuth server launch code to avoid shared port usage
Wires77 May 3, 2026
259cfc4
Remove error code on login and fix hanging item slot controls in trad…
vaisest May 4, 2026
19dc20a
Fix QueryMods.lua generation. Change soulcores.lua to export trade ha…
vaisest May 14, 2026
7d77f33
Add note about trade hashes
vaisest May 14, 2026
4674411
Fix curse querymod.lua test
vaisest May 14, 2026
fe2fcbf
Clear authorization on 403 to fix outdated scope in trader
vaisest May 15, 2026
16a8629
Use enum in mods.lua and format it
vaisest May 17, 2026
89eb71a
Fix typo in mods.lua
vaisest May 19, 2026
ccc8c15
Fix module being a global variable and compare trade helpers into one…
vaisest May 19, 2026
18b8585
Remove forgotten debug prints
vaisest May 19, 2026
fd180ab
Fix trade hash generation
vaisest May 22, 2026
f92e797
add note about radius jewel mods
vaisest May 22, 2026
551ba83
Fix rune weight generation and regenerate QueryMods.lua
vaisest May 22, 2026
776d4b7
Port buy similar improvements from pob1 and improve mod matching
vaisest May 22, 2026
396376a
Fix timeless jewel searching (completely useless)
vaisest May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/lua/socket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function _M.bind(host, port, backlog)
sock, err = socket.tcp6()
end
if not sock then return nil, err end
sock:setoption("reuseaddr", true)
-- sock:setoption("reuseaddr", true)
res, err = sock:bind(alt.addr, port)
if not res then
sock:close()
Expand Down
64 changes: 34 additions & 30 deletions spec/System/TestTradeQueryCurrency_spec.lua
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
describe("TradeQuery Currency Conversion", function()
local mock_tradeQuery = new("TradeQuery", { itemsTab = {} })
local mock_tradeQuery

-- test case for commit: "Skip callback on errors to prevent incomplete conversions"
describe("FetchCurrencyConversionTable", function()
-- Pass: Callback not called on error
-- Fail: Callback called, indicating partial data risk
it("skips callback on error", function()
local orig_launch = launch
local spy = { called = false }
launch = {
DownloadPage = function(url, callback, opts)
callback(nil, "test error")
end
}
mock_tradeQuery:FetchCurrencyConversionTable(function()
spy.called = true
end)
launch = orig_launch
assert.is_false(spy.called)
end)
before_each(function()
mock_tradeQuery = new("TradeQuery", { itemsTab = {} })
end)

describe("ConvertCurrencyToChaos", function()
-- Pass: Ceils amount to integer (e.g., 4.9 -> 5)
-- Fail: Wrong value or nil, indicating broken rounding/baseline logic, causing inaccurate chaos totals
describe("ConvertCurrencyToDivs", function()
-- Pass: Calculates price in divs
-- Fail: Wrong value or nil, indicating broken rounding/baseline logic
it("handles chaos currency", function()
mock_tradeQuery.pbCurrencyConversion = { league = { chaos = 1 } }
mock_tradeQuery.pbCurrencyConversion = { league = { chaos = 0.1 } }
mock_tradeQuery.pbLeague = "league"
local result = mock_tradeQuery:ConvertCurrencyToChaos("chaos", 4.9)
assert.are.equal(result, 5)
local result = mock_tradeQuery:ConvertCurrencyToDivs("chaos", 5)
assert.are.equal(result, 0.5)
end)

-- Pass: Returns nil without crash
-- Fail: Crashes or wrong value, indicating unhandled currencies, corrupting price conversions
it("returns nil for unmapped", function()
local result = mock_tradeQuery:ConvertCurrencyToChaos("exotic", 10)
local result = mock_tradeQuery:ConvertCurrencyToDivs("exotic", 10)
assert.is_nil(result)
end)
end)

describe("PriceBuilderProcessPoENinjaResponse", function()
-- Pass: Processes without error, restoring map
-- Pass: Processes without error, restoring map while adding a notice
-- Fail: Corrupts map or crashes, indicating fragile API response handling, breaking future conversions
it("handles unmapped currency", function()
it("handles empty response", function()
local orig_conv = mock_tradeQuery.currencyConversionTradeMap
mock_tradeQuery.currencyConversionTradeMap = { div = "id" }
local resp = { exotic = 10 }
mock_tradeQuery:PriceBuilderProcessPoENinjaResponse(resp)
mock_tradeQuery.pbLeague = "league"
mock_tradeQuery.pbCurrencyConversion = { league = {} }
mock_tradeQuery.controls.pbNotice = { label = "" }
local resp = { lines = { }}
mock_tradeQuery:PriceBuilderProcessPoENinjaResponse(resp.lines)
-- No crash expected
assert.is_true(true)
assert.is_true(mock_tradeQuery.controls.pbNotice.label == "No currencies received from PoE Ninja")
mock_tradeQuery.currencyConversionTradeMap = orig_conv
end)

-- Pass: Processes without error, restoring map while adding a notice
-- Fail: Corrupts map or crashes, indicating fragile API response handling, breaking future conversions
it("handles empty response", function()
local orig_conv = mock_tradeQuery.currencyConversionTradeMap
mock_tradeQuery.currencyConversionTradeMap = { div = "id" }
mock_tradeQuery.pbLeague = "league"
mock_tradeQuery.pbCurrencyConversion = { league = {} }
mock_tradeQuery.controls.pbNotice = { label = "" }
local resp = { lines = { { malformedLine = "lol"} }}
mock_tradeQuery:PriceBuilderProcessPoENinjaResponse(resp.lines)
-- No crash expected
assert.is_true(true)
assert.is_true(mock_tradeQuery.controls.pbNotice.label == "Currencies not updated: malformed PoE Ninja response")
mock_tradeQuery.currencyConversionTradeMap = orig_conv
end)
end)
Expand Down
4 changes: 2 additions & 2 deletions spec/System/TestTradeQueryGenerator_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ describe("TradeQueryGenerator", function()
-- Pass: Mod line maps correctly to trade stat entry without error
-- Fail: Mapping fails (e.g., no match found), indicating incomplete stat parsing for curse mods, potentially missing curse-enabling items in queries
it("handles special curse case", function()
local mod = { "You can apply an additional Curse" }
local tradeStatsParsed = { result = { [2] = { entries = { { text = "You can apply # additional Curses", id = "id" } } } } }
local mod = { tradeHashes = {[30642521] = {"You can apply an additional Curse"}} }
local tradeStatsParsed = { result = { [2] = { entries = { { text = "You can apply # additional Curses", id = "explicit.stat_30642521" } } } } }
mock_queryGen.modData = { Explicit = true }
mock_queryGen:ProcessMod(mod, tradeStatsParsed, 1)
-- Simplified assertion; in full impl, check modData
Expand Down
36 changes: 36 additions & 0 deletions spec/System/TestTradeQueryRequests_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,42 @@ describe("TradeQueryRequests", function()
launch = orig_launch
end)

-- Pass: Does not crash on 401, and passes error message
-- Fail: Crash, or returned error is wrong
it("does not crash on 401", function()
local json = '"{"error":"invalid_token","error_description":"The access token provided is invalid or has expired"}"'
local header = [[HTTP/1.1 401 Unauthorized
Date: Fri, 24 Apr 2026 07:30:38 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Server: cloudflare
WWW-Authenticate: Bearer realm="pathofexile:production", error="invalid_token", error_description="The access token provided is invalid or has expired"
Cache-Control: no-store
Strict-Transport-Security: max-age=63115200; includeSubDomains; preload]]
local orig_launch = launch
launch = {
DownloadPage = function(url, onComplete, opts)
onComplete({ body = json, header = header }, nil)
end
}
table.insert(requests.requestQueue.search, {
url = "test",
callback = function(body, msg)
assert.are.equal(body, json)
assert.truthy(msg:find("Response code: 401"))
end,
retryTime = nil
})
local function mock_next_time(self, policy, time)
return time - 1
end
mock_limiter.NextRequestTime = mock_next_time
requests:ProcessQueue()
assert.are.equal(#requests.requestQueue.search, 0)
launch = orig_launch
end)

-- Pass: Retries with increasing backoff up to cap, preventing infinite loops
-- Fail: No backoff or uncapped, indicating retry bug, risking API bans
it("retries on 429 with exponential backoff", function()
Expand Down
Loading
Loading