Skip to content

[08.6] [M0.7] Make vendor purchases fully atomic #108

Description

@alseif0x

Parent: #20 (D-C8).

Current 3.4.3 already commits ordinary item purchases as one transaction after PR #107, but the currency-vendor branch still publishes currency gain/costs into session runtime before awaiting commit_transaction. A cancelled handler or an unknown COMMIT result can therefore leave runtime and durable currency/item-turn-in state inconsistent.

C++ anchors:

  • src/server/game/Handlers/ItemHandler.cpp::HandleBuyItemOpcode
  • src/server/game/Entities/Player/Player.cpp::BuyItemFromVendorSlot
  • _StoreOrEquipNewItem / TakeExtendedCost

Rust targets:

  • crates/wow-world/src/handlers/character.rs::handle_buy_item
  • existing player-money persistence/cancellation fence in crates/wow-world/src/session.rs
  • crates/wow-database/src/transaction.rs

Done:

  • Plan currency gains, currency costs, item turn-ins and item/gold mutations without publishing runtime state before durable success.
  • Commit every purchase-owned mutation atomically.
  • Preserve runtime state after a definite rollback.
  • Treat cancelled or unknown COMMIT outcomes as indeterminate and require reload without allowing a stale full save to overwrite the transaction.
  • Focused positive, rollback, and unknown-outcome tests; C++ refs documented.
  • Bot/client capture-diff evidence for a representative vendor purchase before merge.

Closes the D-C8 slice of #20; it does not expand vendor validation/content parity beyond the existing handler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions