Skip to content

Avoid populating cache during eviction - #342

Merged
BenCodez merged 1 commit into
masterfrom
fix/remove-cache-without-population
Sep 24, 2026
Merged

BenCodez merged 1 commit into
masterfrom
fix/remove-cache-without-population

Conversation

@BenCodez

@BenCodez BenCodez commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Keep per-user cache eviction non-populating.

  • use the existing manager map entry directly during removeCache()
  • do not call getCache(), which may populate an absent user from SQL before immediately retiring it
  • preserve exclusive per-user admission and normal flush/retire behavior for caches that actually exist
  • add regression coverage that fails if absent-cache eviction tries to populate user data

Summary by CodeRabbit

  • Bug Fixes
    • Removing an entry that is not currently cached no longer loads it from storage as a side effect. This avoids unnecessary storage access during cache cleanup while preserving cleanup behavior for entries that are already cached.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 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-23T23:10:23.727279Z c8166b7 PR opened
🔒 Security Review ✅ Completed 2026-09-23T23:13:19.560767Z c8166b7 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 Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e930ac4b-f101-4cfa-aa2b-e57cc5d06da7

📥 Commits

Reviewing files that changed from the base of the PR and between 9b8c064 and c8166b7.

📒 Files selected for processing (2)
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/usercache/UserDataManager.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/user/SharedCacheBindingRegressionTest.java

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: build
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (actions)
🔇 Additional comments (2)
AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/usercache/UserDataManager.java (1)

1226-1227: LGTM!

AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/user/SharedCacheBindingRegressionTest.java (1)

747-765: LGTM!


📝 Walkthrough

Walkthrough

Cache removal now checks the published cache map directly. A regression test verifies that removing an absent UUID does not call getCache or add the UUID to the cache.

Changes

Absent Cache Removal

Layer / File(s) Summary
Direct cache lookup and regression test
AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/usercache/UserDataManager.java, AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/user/SharedCacheBindingRegressionTest.java
removeCacheExclusively checks the cache map instead of calling getCache. The regression test verifies that removing an absent UUID does not call getCache and leaves the UUID absent from the manager.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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: preventing cache population during eviction. It matches the code changes, regression test, and stated PR objective.
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.
  • Fix all pre-merge checks with AI
✨ 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

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

@BenCodez
BenCodez merged commit e046e62 into master Sep 24, 2026
5 checks passed
@BenCodez
BenCodez deleted the fix/remove-cache-without-population branch September 24, 2026 00:20
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