fix: stop appending tail when sub-packet has fewer fields than schema#450
Merged
erwan-joly merged 1 commit intomasterfrom Apr 24, 2026
Merged
fix: stop appending tail when sub-packet has fewer fields than schema#450erwan-joly merged 1 commit intomasterfrom
erwan-joly merged 1 commit intomasterfrom
Conversation
The inner field-split loop ran packSeperators.Count iterations regardless of whether the wire item had been exhausted. Once the separator was no longer found (c == -1) on a non-last iteration, it appended the remaining subpacket on every subsequent iteration — producing e.g. "1 9023 33333" from "1.9023.3" against a seven-field IvnSubPacket, which then overflowed RareAmount (short) or raised index-out-of-bounds / format errors downstream. Break after the first exhausted separator: emit the tail once and let the outer DeserializeIPacket leave the rest of the schema's trailing fields at their default values. Resolves observed failures on: inv 1/2 — "Value was either too large or too small for an Int16." sayi / msgi / msgi2 — "Index was outside the bounds of the array." mlobjlst / infoi — "Index was outside the bounds of the array." qslot — "The input string '-1-1' was not in a correct format." fish — "The input string '0.0.0' was not in a correct format." qstlist — "The input string '39.0.0.0.0...' was not in a correct format." pinit — "Requested value '2|5821712|...' was not found." Regression test added round-tripping `inv 1 0.5110.1 1.9023.3` against the seven-field IvnSubPacket. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughThe pull request fixes a bug in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
erwan-joly
added a commit
to NosCoreIO/NosCore.DeveloperTools
that referenced
this pull request
Apr 24, 2026
Picks up: - NosCoreIO/NosCore.Packets#450 (short-subpacket deserialize fix — inv/sayi/msgi/msgi2/mlobjlst/infoi/qslot/fish/qstlist/pinit) - NosCoreIO/NosCore.Packets#451 (TwkPacket setters, PetskiPacket schema, QnamliPacket) - NosCoreIO/NosCore.Packets#452 (direction-pair packets: gidx/npc_req/ rsfi server-side, mall/npinfo client-side) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Bumps to 17.2.0, non-breaking bug fix.
Single-line change in the inner field-split loop plus an early-exit. The loop was iterating for every property of the schema, appending the remaining subpacket on every iteration once the separator was exhausted — producing values like
"1 9023 33333"from"1.9023.3"against a 7-field schema, which then failed with Int16 overflow, index-out-of-bounds, or format errors depending on the field type.Resolves observed failures on
inv/sayi/msgi/msgi2/mlobjlst/infoi/qslot/fish/qstlist/pinit.Test plan
inv 1 0.5110.1 1.9023.3against the seven-fieldIvnSubPacketand asserts the trailing fields default.Summary by CodeRabbit
Bug Fixes
Chores