Fix trader crashes on object-form mods, make Find best return URL only#5
Merged
Conversation
added 2 commits
July 25, 2026 19:42
The trade API migrated item mods from plain strings to objects carrying a description and flags. Commit 2d09769 adapted explicitMods only, so any item whose runeMods/enchantMods/implicitMods were populated crashed with "attempt to call method 'gsub' (a nil value)" — escapeGGGString was handed a table. Use the same format-agnostic idiom already ported into ImportTab.lua, and apply it to pseudoMods too, which crashed the same way one line later on :match. That guard also fixes a pre-existing crash on an empty pseudoMods array, which previously indexed nil rather than falling back to "0".
Register the generated search so the short shareable link can be built, then stop. The item listings are no longer fetched, parsed or sorted, so the row stays on [Find best][url][Price Item] instead of flipping to the result dropdown. "Price Item" remains available on that URL for when the items are actually wanted. The URL is set before the error branch so an empty search still yields a link to loosen in the browser. This orphans the Augment/Anoint Behaviour dropdowns in the Find best dialog: their only consumer was the post-fetch item rewriting removed here. Left in place rather than wired into "Price Item", which fires on whatever URL is in the box and would rewrite hand-pasted results based on a dropdown set during an unrelated search.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trade API object-form mods
The trade API migrated item mods from plain strings to objects (
{description, flags}). Commit 2d09769 adaptedexplicitModsonly, so any item with rune/enchant/implicit mods crashed:escapeGGGStringwas being handed a table. Fixed with the format-agnostic idiom already ported intoImportTab.lua:1333, applied to all four mod loops pluspseudoMods, which crashed the same way one line later on:match.Also fixes a pre-existing crash on an empty
pseudoModsarray — the oldpseudoMods and pseudoMods[1]:match(...)indexed nil instead of falling back to"0"."Find best" returns the URL only
Swapped
SearchWithQueryWeightAdjusted(search → fetch every result block → parse → sort → populate dropdown) for a barePerformSearch, which is just the search POST that returns the query ID. The row now stays on[Find best][url][Price Item]rather than flipping to the result dropdown.Price Itemstill works on that URL when the items are actually wanted.Known consequence: the Augment/Anoint Behaviour dropdowns in the Find best dialog (
TradeQueryGenerator.lua:1138,:1156) are now orphaned — their only consumer was the post-fetch item rewriting removed here.Testing
Verified in the running app (macOS native build): both crashes gone, Find best now fills the URL field without listing items.