Repository navigation
fix(api): prevent shared MySQL getPoints() loading exceptions - #1740
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
Problem
EconomyShopGUI calls
VotingPluginUser.getPoints()directly as an economy balance. With current AdvancedCore shared MySQL cache guards, a click on a player whose shared snapshot is not yet published throwsIllegalStateException: Shared user data is still loading. VotingPlugin #1739 fixed the placeholder path, not the Java API. VotingPlugin 7.1.1 had the samegetPoints()method, but its corresponding AdvancedCore version could synchronously fall through to a MySQL read.Change
getPoints()read a published, point-fenced snapshot. If unavailable (cold, invalidated, pending/uncertain debit), return the historical integer default0instead of throwing or blocking for SQL. A missing balance is not proof of an actual zero.getPointsIfLoaded(): OptionalIntso new integrations can distinguish loading from genuine zero without unsafe default-value semantics.Verification
Added
VotingPluginUserPointReadCompatibilityTestfor cold cache, known zero, invalidated/partially published cache, pending mutation, malformed values, per-server point column, ordinary storage and worker reads.Build/testing pending. This is a draft PR for CI validation and independent review. No local Maven build was possible in the connected environment, and the change has not been runtime-tested against EconomyShopGUI.
Important
No reversion of AdvancedCore's shared-storage protection and no synchronous JDBC on Bukkit/Paper/Folia-owned threads. Do not merge before CI and independent review verify the direct API and economy integration behavior.
Summary by CodeRabbit