Skip to content

Populate cold offline placeholder entries in all-player modes - #1736

Merged
BenCodez merged 1 commit into
masterfrom
fix/cold-offline-placeholder-cache
Oct 25, 2026
Merged

BenCodez merged 1 commit into
masterfrom
fix/cold-offline-placeholder-cache

Conversation

@BenCodez

@BenCodez BenCodez commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Offline requests could keep returning pending markers because refresh skipped players without a cached entry or login warmup. Permit population in AUTOALL and SPECIFICALL while preserving online-only cache modes, explicit processing, entity-owned evaluation and the existing offline fallbacks.

Cold-entry admission occurs only inside the existing queued refresh callback; direct non-login updates retain their prior contract. It adds no configuration, dependency requirement, API or player-data migration.

Validation:

  • 22 new regressions exercise the real loader and public requests: configured monthly totals and points, automatic admission, warm/online controls, calculating data, worker restrictions, offline fallback, reconnect, reload and logout.
  • 36 focused tests pass.
  • Full clean package: 2,607 unit tests pass, one optional diagnostic is skipped, and five artifact checks pass. All prior unit/artifact outcomes are retained.
  • Fresh independent source review returned no findings.
  • Actual suite classpaths, dependency hashes, archive integrity and test-class exclusion verified against published AdvancedCore snapshot134 and SimpleAPI43 using a private validation selector. The production POM is unchanged.

The validation JAR is 10,889,337 bytes, above the advisory10MiB target. Hosted checks and live PlaceholderAPI/Paper/Folia acceptance are separate; no live-server acceptance is claimed.

Created with assistance from OpenAI Codex.

Summary by CodeRabbit

  • Bug Fixes
    • Placeholder checks now process uncached entries during warmup in cache modes that support offline caching. Online-only mode continues to process entries only for online players.
    • This helps keep placeholder values available across online and offline cache scenarios, including after scheduled updates and cache reloads.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-10-25T05:49:34.704927Z 3db2ba2 PR opened
🔒 Security Review ✅ Completed 2026-10-25T05:51:10.884812Z 3db2ba2 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26e5674f-2094-4f0b-9242-0f50a50b6370
Commits

Reviewing files that changed from the base of the PR and between 8c098ed and 3db2ba2.

Files selected for processing: 2
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/placeholders/PlaceHolders.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/placeholders/ColdOfflinePlaceholderCacheTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details
Context from checks skipped due to timeout: 3
  • GitHub Check: build
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (java-kotlin)
Additional context used
Code guidelines: 1
AGENTS.md — auto-discovered
Path-based instructions: 1
Source excerpt: All project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage.

CodeRabbit inference engine (AGENTS.md)

Files:

  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/placeholders/ColdOfflinePlaceholderCacheTest.java
Learnings: 1
Common learnings
Learnt from: CR
Repo: BenCodez/VotingPlugin PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-20T09:11:25.910Z
Learning: Source excerpt:
# Maintainer and AI-agent guide

## Build and verification

All project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage. Keep paths and package declarations aligned, and update cross-test imports, resources, and build selectors when moving tests. Preserve package-phase artifact checks and test discovery. Do not widen production APIs to make tests accessible; use narrowly scoped test-only reflection for non-public seams. Platform API fixtures that must retain an external runtime class identity (such as `net.minecraft.network.chat.Component`) stay in that platform package and must not contain test cases.
Learnt from: CR
Repo: BenCodez/VotingPlugin PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-20T09:11:25.910Z
Learning: Applies to VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/** : Source excerpt:
# Maintainer and AI-agent guide

## Build and verification

All project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage. Keep paths and package declarations aligned, and update cross-test imports, resources, and build selectors when moving tests. Preserve package-phase artifact checks and test discovery. Do not widen production APIs to make tests accessible; use narrowly scoped test-only reflection for non-public seams. Platform API fixtures that must retain an external runtime class identity (such as `net.minecraft.network.chat.Component`) stay in that platform package and must not contain test cases.
ast-grep (0.45.3)
VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/placeholders/ColdOfflinePlaceholderCacheTest.java

[warning] 369-369: Regular expression is compiled from a non-literal, possibly user-controlled value. A crafted regex (or input matched against one) can trigger catastrophic backtracking and hang the thread (ReDoS). Use a hardcoded literal pattern, wrap untrusted text with Pattern.quote(...), or validate/length-limit the input and enforce a matching timeout before passing it to Pattern.compile / String.matches / String.replaceAll / String.replaceFirst.
Context: p.matches(identifier)
Note: [CWE-1333] Inefficient Regular Expression Complexity.

(redos-non-literal-regex-java)

Additional comments: 2
VotingPlugin/src/main/java/com/bencodez/votingplugin/placeholders/PlaceHolders.java: 1

1508-1508: LGTM!

Also applies to: 1593-1595

VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/placeholders/ColdOfflinePlaceholderCacheTest.java: 1

1-372: LGTM!

Walkthrough

The scheduled placeholder check now admits uncached entries when the cache mode is not online-only or the user is online. New tests cover cache modes, worker and platform placeholders, and cache behavior across reloads, logouts, and completion.

Changes: Placeholder cache behavior

Layer / File(s) Summary
Cache admission and mode behavior
VotingPlugin/src/main/java/com/bencodez/votingplugin/placeholders/PlaceHolders.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/placeholders/ColdOfflinePlaceholderCacheTest.java
The scheduled callback admits uncached entries when caching is not online-only or the user is online. Tests cover cold and warm entries, cache modes, direct evaluation, and request suffixes.
Worker, platform, and lifecycle behavior
VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/placeholders/ColdOfflinePlaceholderCacheTest.java
Tests cover worker-thread access, platform placeholder fallbacks, queued work, reload and logout behavior, and non-login completion.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: copilot

Merge Risk: Minimal · up to 3db2b

The cache admission change appears ready to merge after normal checks; no actionable issue was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 5.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: populating cold offline placeholder entries in all-player cache modes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BenCodez
BenCodez merged commit c3248a0 into master Oct 25, 2026
6 checks passed
@BenCodez
BenCodez deleted the fix/cold-offline-placeholder-cache branch October 25, 2026 17:17
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