Deposit, withdraw and delete ignore economy failures

オープン 初心者向け
#66 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java

調査の方向性

既存の失敗処理とテストパターンを確認するため、Transaction.process と TransactionTest を読み、その後 deposit、withdraw、DeleteCommand の実装を探してください。store の残高が変わる前に各 economy の応答がどのように処理されるかを確認し、3つすべてのコマンドについて、economy が拒否する場合のテストを追加してください。各トランザクションが拒否されたときに store が変更されず、TRANSACTION_FAILED が報告されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

Problem

/shop deposit, /shop withdraw and /shop delete ignore the result of their economy calls. If the economy plugin rejects the change, the store's balance changes anyway and the player is told it worked.

Transaction.process already handles this correctly by moving the player's money first and stopping if that fails.

Reproduced with an economy that rejects every change:

  • /shop deposit 100 added 100 to the store without taking anything from the player, and reported success.
  • /shop withdraw 40 removed 40 from the store without paying the player, and reported success.

DeleteCommand has the same pattern: it clears the balance and removes the store whatever depositPlayer returns.

Scope

  • Check EconomyResponse.transactionSuccess() before changing the store, in all three commands.
  • Send TRANSACTION_FAILED when the economy rejects the change, and leave the store as it was.

Done when

  • A rejected deposit, withdrawal or delete payout changes nothing and tells the player it failed.
  • Tests cover each command with a rejecting economy, using the existing approach in TransactionTest.
主要言語
Java
スター
1
フォーク
0
平均マージ
2時間 35分
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

BrendonButler/Shops のほかの issue

BrendonButler/Shops の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。