Skip to content

Suppress unnecessary "failed to get id for item" errors - #3339

Open
jordanbrymora wants to merge 6 commits into
developmentfrom
SuppressFailedItemIdErrors
Open

Suppress unnecessary "failed to get id for item" errors#3339
jordanbrymora wants to merge 6 commits into
developmentfrom
SuppressFailedItemIdErrors

Conversation

@jordanbrymora

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • All new classes have class-level documentation comments, if there are any at all
  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bug fix (non-breaking change that fixes an issue)

What is the current behavior?

TradeHandler.TryResolveItemRosterId outputs an error when it fails to resolve the id of an item. The problem is that an ItemRoster can have empty ItemRosterElements with null item values.

What is the new behavior?

Add an earlier check to return if the item in the ItemRosterElement is null to avoid logging unnecessary errors.

@garrettluskey garrettluskey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the empty roster-slot diagnosis is right, but the unresolved scope issue in the existing thread still needs to be fixed before this can go in.

Comment thread source/GameInterface/Services/Inventory/Handlers/TradeHandler.cs
Comment thread source/GameInterface/Services/Inventory/Handlers/TradeHandler.cs Outdated
jordanbrymora and others added 3 commits August 26, 2026 09:36
Co-authored-by: Garrett Luskey <garrett.luskey@gmail.com>

@garrettluskey garrettluskey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the empty roster-slot diagnosis is right. this still leaves the noisy path unchanged, so changes are needed before this fixes the reported error.

Comment thread source/GameInterface/Services/Inventory/Handlers/TradeHandler.cs

@garrettluskey garrettluskey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching the discard path from the backing array to the roster's active range fixes the noisy default tail-slot case. Changes are still needed because the new caller-side guards also suppress real resolution failures.

Comment thread source/GameInterface/Services/Inventory/Handlers/TradeHandler.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants