Skip to content

Fix duplicated socket parsing on item rebuild - #2367

Draft
mcagnion wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
mcagnion:fix/item-import-rune-sockets
Draft

mcagnion wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
mcagnion:fix/item-import-rune-sockets

Conversation

@mcagnion

@mcagnion mcagnion commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

Pasted game items with structured Sockets: lines could rebuild with duplicate socket lines after an edit/save/reimport cycle. Item:ParseRaw parsed Sockets: and Rune: spec lines into structured item fields, but those lines could also remain as modifier text and be emitted again by BuildRaw.

This PR consumes those structured spec lines after parsing them, so socket and rune data is kept in the item fields without duplicating the original text line.

Steps taken to verify a working solution:

  • Added regression coverage in spec/System/TestItemParse_spec.lua for ParseRaw -> BuildRaw -> ParseRaw on a pasted item with Sockets: S S; the rebuilt raw item keeps one Sockets: line and reparses to two sockets.
  • busted ../spec/System/TestItemParse_spec.lua (65 passed)
  • busted ../spec/System/TestItemsTab_spec.lua (53 passed)
  • Manually checked the before/after item tooltips below: the duplicate unsupported red Sockets: modifier is gone, while the structured socket header remains.

Before screenshot:

before-duplicate-sockets

After screenshot:

after-duplicate-sockets

Avoid treating parsed Sockets and Rune lines as item modifier text so rebuilt pasted items do not gain duplicate sockets after Edit/Save.
awlego pushed a commit to awlego/PathOfBuilding-PoE2 that referenced this pull request Oct 19, 2026
Ported from upstream PathOfBuildingCommunity#2367.
When a pasted item had its Sockets: line after Item Level or the mods, the
Sockets: and Rune: lines were also stored as mod lines, so BuildRaw wrote
them twice and the rebuilt item doubled its sockets. Only the first
Sockets: line is used and both lines are no longer kept as mods.

Adapted: the PR's spec uses the new("Item"):Item() constructor style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant