Skip to content

Check the session before spending focus and refuse an old TLibs - #17

Merged
ryanbarlow97 merged 1 commit into
mainfrom
fix/identity-review
Oct 12, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
fix/identity-review

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

Confirming an experiment spent focus and only then re-checked the menu's character session. If that re-check failed, the focus was gone and the experiment made no progress, and a test locked that in. The click handler already checks the session before any action runs, and spending focus cannot end a session, so the late re-check is removed. The test now covers the real case: a menu whose session has ended cannot spend focus or progress the project.

Research also had no TLibs version check. With a TLibs older than 2.3.0 its listeners failed to register and the plugin stayed enabled doing nothing. It now logs "Research requires TLibs 2.3.0 or newer" and disables itself at startup, matching Infestations and Surgery, and skips its disable-time unload when it never started.

mvn clean verify passes: 259 tests, coverage gate met.

Docs: TF-Minecraft/Docs#171

🤖 Generated with Claude Code

A confirmed experiment spent focus and only then re-checked the menu's
session, so a failed re-check lost the focus with no progress. The click
handler already checks the session before anything runs, and spending focus
cannot end a session, so the late re-check is gone.

Research now disables itself at startup with a clear message when TLibs is
older than 2.3.0, instead of staying enabled without its listeners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 12, 2026
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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: 68c7903c-4108-4a4d-a6b6-611a28b1b87c

📥 Commits

Reviewing files that changed from the base of the PR and between 82dc3fd and bbd1d25.


📒 Files selected for processing (4)
  • src/main/java/net/tfminecraft/research/Research.java
  • src/main/java/net/tfminecraft/research/manager/ResearchManager.java
  • src/test/java/net/tfminecraft/research/ResearchLifecycleTest.java
  • src/test/java/net/tfminecraft/research/manager/ResearchManagerTest.java

💤 Files with no reviewable changes (1)
  • src/main/java/net/tfminecraft/research/manager/ResearchManager.java

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



📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Experiment confirmation is blocked after a character session has ended, preventing mental points from being spent or experiment results from being applied.
    • The plugin now stops startup cleanly when the required TLibs character support is unavailable.
  • Compatibility
    • TLibs 2.3.0 or newer is required for the plugin to start.

Walkthrough

Startup now checks TLibs availability and unloads research only after the manager starts. Experiment confirmation no longer checks whether the station-menu holder is current. Tests cover the startup failure and confirmation after a session ends.

Changes

Plugin startup lifecycle

Layer / File(s) Summary
Startup guard and lifecycle
src/main/java/net/tfminecraft/research/Research.java, src/test/java/net/tfminecraft/research/ResearchLifecycleTest.java
Startup stops if the TLibs availability check throws a LinkageError. The plugin sets started after the manager starts and unloads research only when started is true. A test covers startup when the character class is missing.

Experiment confirmation

Layer / File(s) Summary
Confirmation and ended-session test
src/main/java/net/tfminecraft/research/manager/ResearchManager.java, src/test/java/net/tfminecraft/research/manager/ResearchManagerTest.java
Experiment confirmation no longer checks whether the inventory belongs to the player’s current station menu. The test ends the session before confirmation and checks that focus is not spent, the input is not marked tested, and no aspect points are awarded.

Priority: ⬇️ Low

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

Change: Bug fix


Merge Risk: ⚪ Minimal · up to bbd1d

The startup and experiment-confirmation changes have no established merge-blocking issue. Normal checks remain appropriate before merging.

  • 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.

@ryanbarlow97
ryanbarlow97 merged commit 40d55f8 into main Oct 12, 2026
3 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/identity-review branch October 12, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant