You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Cleanup allocations by session caching code
* Even further cleanup, no weak references are needed
* back to asMap
* Keep World for the test itself, cache string for key
Cached player sessions are reset before movement resumes after rejoining; no actionable merge-blocking issue remains.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 17 functions across 19 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
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.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
[warning] 47-47: Prevent path traversal
Context: new File(getDataFolder(), "config.yml")
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). Security best practice.
This is a comment left during a code review.
Repository: https://github.com/Chloemlla/WorldGuard
Path: worldguard-core/src/main/java/com/sk89q/worldguard/session/AbstractSessionManager.java
Line: 180-184
Comment:
get() 的会话创建改为非原子的 getIfPresent 加 put,可能重复创建 Session
AbstractSessionManager.get() 将原本原子的 sessions.asMap().computeIfAbsent 换成了 getIfPresent 加 put;同一玩家的两个线程同时进入时都可能读到 null 并各自创建 Session,后写入者覆盖前者。返回给其中一个调用方的 Session 随即脱离缓存,导致两套 Handler 状态(如 bypass 开关、进出区域与无敌状态)分裂,并可能重复执行初始化,应改用仍保持原子性的 sessions.get(uuid, () -> new Session(this)) 之类方式。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This is a comment left during a code review.
Repository: https://github.com/Chloemlla/WorldGuard
Path: worldguard-core/src/main/java/com/sk89q/worldguard/session/AbstractSessionManager.java
Line: 180-184
Comment:
get() 的会话创建改为非原子的 getIfPresent 加 put,可能重复创建 Session
AbstractSessionManager.get() 将原本原子的 sessions.asMap().computeIfAbsent 换成了 getIfPresent 加 put;同一玩家的两个线程同时进入时都可能读到 null 并各自创建 Session,后写入者覆盖前者。返回给其中一个调用方的 Session 随即脱离缓存,导致两套 Handler 状态(如 bypass 开关、进出区域与无敌状态)分裂,并可能重复执行初始化,应改用仍保持原子性的 sessions.get(uuid, () -> new Session(this)) 之类方式。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated upstream sync by fork-sync.
EngineHubversion/7.0.xChloemlla/WorldGuardversion/7.0.xIf this PR has conflicts, please resolve manually. Clean PRs are auto-merged.
Summary by CodeRabbit