Quick answer: Make item operations atomic and server-authoritative, so a disconnect leaves the item in a consistent place, and log transactions to recover from interruptions.
Item loss on disconnect is non-atomic operations. Atomic, server-side handling fixes it. Here is how.
How to fix it
1. Make operations atomic
Item moves must fully complete or fully roll back as one server operation. A remove-then-add that is interrupted by a disconnect between the steps loses the item. Atomicity guarantees it lands somewhere.
2. Keep authority on the server
The server owns the inventory and executes the operation, so a client disconnect cannot leave the authoritative state half-updated. Client-side item handling loses items the moment the connection drops.
3. Log and recover transactions
Log item transactions so an interrupted one can be detected and completed or reversed on reconnect. This lets you recover items that a disconnect caught mid-operation rather than losing them permanently.
Catching the ones you can't reproduce
The hardest version of this to fix is the one you can't reproduce — it only happens on a player's hardware, OS, driver, or save state, under conditions that simply aren't present on your machine. A report that says “it crashed” or “it froze” gives you nothing to act on, so the bug survives release after release while quietly costing you players.
Automatic error capture closes that gap. Each failure arrives with its full stack trace, the device and OS, the build number, and a breadcrumb trail of what the player did right before it broke, so even a failure you have never seen becomes a specific, reproducible issue. Fold identical failures into one signature ranked by how many players each hits, and your worklist sorts itself worst-first instead of arriving as a stream of vague complaints.
This is where a tool like Bugnet earns its place. Its SDK captures every error automatically with the full stack trace plus device, OS, memory, build, and game-state context, folds duplicates into one grouped issue with an occurrence count, and ties each to the build it first appeared on — so you fix the problem that hurts the most players first and confirm it is gone when its signature disappears from the next release.
Most of the time the fix is small. Seeing the failure clearly is the part that actually costs you.