Skip to content

Extract shared user-data reads while preserving caches and storage hooks - #314

Closed
BenCodez wants to merge 1 commit into
masterfrom
codex/shared-user-data-reader
Closed

BenCodez wants to merge 1 commit into
masterfrom
codex/shared-user-data-reader

Conversation

@BenCodez

@BenCodez BenCodez commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Third requested platform-preparation PR: the first user/data extraction step, scoped to the actual scalar read policy rather than attempting the entire storage and reward port in one change.

  • Move UserData's integer/string read policy into core.user.UserDataReader with neutral UserDataReadContext.
  • Adapt the existing user, cache and storage/file callbacks through bukkit.user.BukkitUserDataReadContext.
  • Keep UserData's constructor, public overloads and temporary-cache field/getter/setter intact. The existing Bukkit path delegates to the extracted policy immediately.
  • Preserve all six fetch modes, temp/user-cache/storage precedence, type conversions, null handling, cache refresh ordering and SQL versus flat-file error behavior.
  • Retain virtual getMySqlRow/getSQLiteRow/getData dispatch and current UUID lookup. No second user record, identity resolver or cache is introduced.
  • Add 15 tests, including a dependency-clean fixture, isolated no-Bukkit execution and existing-facade/subclass compatibility tests.

Compatibility and scope

All setters, write callbacks, async write order, list encodings, database schemas, file formats and reward queues are unchanged. Existing UserData tests remain intact. The original private tempCache field is read through a supplier rather than introducing calls to an overridable getter. The actual published UserData diff was inspected: production changes are limited to the reader field/initialization/imports and delegation of the two scalar policy methods, plus the final file newline.

This begins the users/storage/reward phase; it does not claim portable storage providers, the full AdvancedCoreUser lifecycle, reward execution, offline delivery or the SQLite implementation. Those remain focused follow-ups. Native artifact packaging is also separate; the current full AdvancedCore JAR is not a mod artifact.

One existing POM, core/Bukkit packages, no submodules, no workflows, no dependency updates. This PR targets master independently of #313 because their changed production files do not overlap. No unpublished SimpleAPI#78 API is required.

Verified build

Existing Java CI with Maven — run 531 passed on Java 21. Inspected build job 101921425288 and its actual Maven log:

  • mvn -B -f AdvancedCore/pom.xml package — BUILD SUCCESS.
  • 293 tests, zero failures/errors/skips.
  • All nine UserDataReaderTest cases and six UserDataFacadeCompatibilityTest cases passed, including no-Bukkit execution and subclass/cache identity checks.
  • Existing user-data, fetch-mode, storage, reward and queue regression suites passed.
  • AdvancedCore.jar was generated and normal shading/minimization completed.
  • Tested PR merge ref 0e060e57b33408ca62aa0e52c0e448e31efea517 for head ce94c905278681f93cd42dbb2c1d0a28eb032ef1 and base 5fe205bca26236a92ee2fda1634f056639b307a3.

Locally compiled the shared read classes with Java 21 and the previously validated SimpleAPI core data-value artifact. The same pure-Java fixture passed all eight behavioral scenarios: fetch-mode precedence, invalid temporary values, cache capture/callbacks, missing-cache handling, scalar conversion differences, SQL duplicate/error behavior, empty/flat reads and live temporary-map changes. This is component validation, not a full project build.

The editing container has no Maven/dependency network access. Full Maven results above are from GitHub Actions, not local Maven. No current downstream VotingPlugin build, live database/server test or independent reviewer execution is claimed. Source inspection is same-context.

Related: #313 and BenCodez/SimpleAPI#78. Nothing is merged, deployed or remotely published.

AI disclosure: This implementation and pull-request description were prepared with assistance from ChatGPT.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T02:58:13.204843Z ce94c90 Draft marked ready
🔒 Security Review ✅ Completed 2026-09-08T02:59:44.436882Z ce94c90 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant