Skip to content

Run the pet estate pass once ownership is ready after a restart - #46

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/estate-first-pass-after-ready
Oct 22, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/estate-first-pass-after-ready

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Why

PetEstate.start schedules the hourly estate pass to first run on tick 1. On a normal start, reviewed heirs (legacyHeirsReady) are not ready yet, and PetsPlugin's heir wait only migrates ownership a moment later.

So after every restart, the first pass answered RETRY ("Reviewed pet ownership and persistence are not ready") for every decided estate:

  • It overwrote DONE answers in RPCharacters' estate records.
  • Pets and pet houses that still had to move waited up to an hour for the next pass.

Seen on Main after the 10-22 06:10 restart: RETRY at 06:10:46 and DONE at 07:11 for all 13 decided estates. Dev shows the same: RETRY at 08:04:46 for all 7.

What changes

  • The hourly pass waits for ownership. PetEstate.reconcile now skips quietly while ownership is not ready, so it no longer reports RETRY. A persistence conflict is still reported as BLOCKED.
  • The heir wait runs the pass once. When ownership becomes ready, the heir wait in PetsPlugin runs reconcile() a single time, right after it cancels itself. An exception there therefore cannot re-run the migration loop.
  • settle() is unchanged. Direct calls from RPCharacters still answer RETRY while ownership is not ready, and RPCharacters' own hourly retry still records it if ownership never becomes ready.

Tests

  • New hourlyPassWaitsSilentlyForReadinessButStillReportsAPersistenceConflict checks three cases: no report while not ready, DONE once ready, and BLOCKED on a conflict even while not ready.
  • lateReviewedHeirsMigrateBeforeAuthorityAndKeepExistingLoadedPets now checks two things: the tick-1 pass does not query decided estates while heirs are pending, and the heir wait runs the pass once they are ready.
  • mvn verify locally: 1057 tests pass and coverage is clean for the changed classes. The Windows run uses a local-only directory-fsync workaround that is not committed; it is the same issue that makes about 237 tests fail on main under Windows. That workaround also excludes ancestorDirectorySyncFailure….
  • Dev: see the test comment below.

Draft: not for merge or release yet.

🤖 Generated with Claude Code

The hourly estate pass first runs on tick 1, before reviewed heirs are
ready, so after every restart it answered RETRY ("Reviewed pet ownership
and persistence are not ready") over estates it had already settled, and
pets waited up to an hour for the next pass.

The pass now skips quietly until ownership is ready (a persistence
conflict is still reported as blocked), and the heir wait runs it once
as soon as ownership becomes ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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: 0e764cd6-4f80-497f-8a12-710e72ac7f6d
📥 Commits

Reviewing files that changed from the base of the PR and between e5e2727 and c2f4ac4.

📒 Files selected for processing: 4
  • src/main/java/net/tfminecraft/companionpets/PetsPlugin.java
  • src/main/java/net/tfminecraft/companionpets/estate/PetEstate.java
  • src/test/java/net/tfminecraft/companionpets/PetsPluginLifecycleTest.java
  • src/test/java/net/tfminecraft/companionpets/estate/PetEstateTest.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
    • Estate decisions now wait until heir access and ownership records are ready, preventing premature processing during startup.
    • Pets are reattached before the estate is reconciled when ownership becomes ready.
    • Persistence conflicts continue to be reported, including when estate processing is otherwise waiting for readiness.

PetEstate now exposes its registered instance and delays reconciliation until heir access and ownership persistence are ready, except when a persistence conflict exists. PetsPlugin retains the instance and reconciles it after the existing migration flow completes when heirs become ready.

Changes: Estate reconciliation

Layer / File(s) Summary
Readiness-aware estate reconciliation
src/main/java/net/tfminecraft/companionpets/estate/PetEstate.java, src/test/java/net/tfminecraft/companionpets/estate/PetEstateTest.java
PetEstate.start returns the registered estate instance. settle uses a shared readiness check. reconcile skips decision processing while heirs are unready unless a persistence conflict exists. Tests cover readiness and persistence-conflict outcomes.
Reconcile after heirs become ready
src/main/java/net/tfminecraft/companionpets/PetsPlugin.java, src/test/java/net/tfminecraft/companionpets/PetsPluginLifecycleTest.java
PetsPlugin retains the estate instance and calls reconcile after the existing migration flow when heirs become ready. The lifecycle test checks that decisions are not reported while heirs are pending and are reported after readiness.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to c2f4a

No actionable merge-blocking risk remains from the reviewed changes.

- [ ] 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.

@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 22, 2026
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Dev test (TFMCDev01, 2026-10-22)

Jar companionpets-DEV-20261022-estate.jar (this branch) replaced companionpets-DEV-20261021-2114.jar, the #45 test build that this branch already contains. Dev was restarted at 08:28 UTC.

Dev has 7 decided estates. Their companionpets answers in RPCharacters/data/estates:

Old jar, startup 08:04 This branch, startup 08:29
Answer RETRY "Reviewed pet ownership and persistence are not ready", all 7 at 08:04:46 DONE, all 7 at 08:29:31

Done (48.790s) was logged at 08:29:33. There were no CompanionPets warnings or errors in the log.

@XxFran10xX
XxFran10xX marked this pull request as ready for review October 22, 2026 10:53
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Sol (gpt-6.1-sol) review: VERDICT: APPROVE, no correctness findings.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit afcc18f into main Oct 22, 2026
4 checks passed
@XxFran10xX
XxFran10xX deleted the fix/estate-first-pass-after-ready branch October 22, 2026 11:00
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