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

Fix duplicated socket parsing on item rebuild#2367
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

Fixes # .

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.
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