Harden customize-item mod parsing to reject malformed entries and prevent persistent bad equips#7
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/umin135/Polaris_TKDataModEditor/sessions/1eda21fa-487d-4ed9-9035-61a2c838abab Co-authored-by: dawc17 <100421659+dawc17@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix possible irreversible customization error
Harden customize-item mod parsing to reject malformed entries and prevent persistent bad equips
Apr 17, 2026
dawc17
marked this pull request as ready for review
April 17, 2026 22:31
Copilot stopped work on behalf of
dawc17 due to an error
April 17, 2026 22:31
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.
Malformed
customize_item_*payloads could be loaded even when required fields were missing, allowing invalid items to be equipped and persisted in save data. This change tightens parser acceptance criteria so malformed customization entries are dropped before they can be emitted back into mods.Problem scope
customize_item_common_list.binandcustomize_item_unique_list.binaccepted structurally invalid rows (e.g., missing IDs or asset keys), which could propagate bad customization records.Parser hardening
item_idand non-empty key text fields.asset_name.ParseCustomizeItemCommonJsonnow appends only validated entries.ParseCustomizeItemUniqueListJsonnow returns failure when both arrays are empty after validation.Generic array parsing behavior
ParseExclusiveArray(...)to only push entries whenparseFn(...)returnstrue, enabling per-entry rejection consistently across call sites.Load-path gating
LoadFromPath(...)now conditionally addscustomize_item_unique_list.binonly when parsing succeeds, aligning with existing guarded behavior used for other bins.User recovery guidance