fix(inventory): prevent phantom/ghost items in inventory#317
fix(inventory): prevent phantom/ghost items in inventory#317olisikh wants to merge 2 commits intosven-n:mainfrom
Conversation
|
Can you elaborate on the symptom? |
|
Hi, sure. Sorry forgot to explain the problem in detail. The problem:
Both of these happened to me quite often when I moved items between inventory - inv-extension - stash - stash-extension, or when MuHelper looted an item while on a long AFK session. Running this PR currently on my fork and it works pretty well so far. I did not see this problem since. Happy to change anything or close this PR if it makes no sense. I am not a C++ pro. There's also a PR for the server that should catch 99% of such issues, while this PR catches another 1% of desynchronization, + self-healing through PS |
|
A slightly better-explained summary from Codex: This PR hardens client inventory state handling to recover from desyncs that caused phantom items, disappearing items, and relog duplication symptoms. I.e. client stops trusting broken local inventory data. What changed
Expected impact
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the inventory system's reliability by preventing and resolving 'phantom' or 'ghost' item issues. It introduces a set of new, robust item management utilities and integrates them throughout the inventory control, extension, and network communication layers. The changes ensure that the client-side inventory accurately reflects the server's state, enhancing user experience by eliminating visual discrepancies and unexpected item behaviors. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several new methods for inventory management, including RemoveItemAt, FindItemFromSlotIndex, ClearSlotKey, and RequestInventoryRefresh, and refactors existing code to utilize them. The changes aim to centralize item lookup and removal logic, improve inventory synchronization by requesting refreshes when item operations fail, and extend item finding capabilities to inventory extensions. Review feedback highlights potential issues where FindItemFromSlotIndex and CheckSlot might incorrectly handle reserved slots (key 1), leading to unintended clearing or unblocking. Additionally, it suggests implementing throttling for RequestInventoryRefresh to prevent excessive network calls and recommends moving state-modifying and network operations out of the Render function for better separation of concerns.
Leaving this PR as a draft for now. I am running it myself and it works for now.