Repository navigation
Send waiting letters on with the estate (stage 6b) - #38
Merged
Merged
Conversation
New letters record the sending character (senderCharacterId) in flight and in the pending queue, and queued letters keep the mail ID. The store gains what estates need: stored IDs for letters queued earlier, moves to an heir or back to the writer, and an account-keyed returned queue in returned_mail.yml for letters that never recorded their writer. A letter coming back because its recipient died says so; one returned to an account arrives at that account's next character session, marked as returned. The account queue is saved before the dead character's queue drops a letter, and load discards a copy left behind by a crash in between. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The birdmessenger estate participant moves the testator's pending letters. With a will heir they are re-keyed (character and account) to the heir and delivered as normal mail. Without one, each goes back to the character that wrote it, marked "Returned: the recipient has died"; a letter from before writers were recorded goes to the writer's account queue; a letter whose writer is dead or unknown, or the testator's own unsent letter, stays and is counted as held for staff (it goes back if the writer lives again). Each moved letter carries a stored ID; a journal per death (estates/<deathId>.yml) lists them before the queue changes, so DONE always carries every moved ID. In-flight letters are left alone and moved by the hourly reconcile once they land. The participant registers after mail loads, only when TLibs has the estate API, reconciles on the first tick and hourly over decided estates, and reports changed outcomes with the revision answered. Pins TLibs 2.6.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
Mail queues are now written whole: a flushed temporary file moved over the queue, then the folder flushed. Estate moves no longer use the saves that only log a failure: identifyPending and moveEstateLetters throw when a queue cannot be saved, and put the queues back in memory first, so the participant answers RETRY instead of DONE for letters that never reached disk. Every receiving queue is checked before anything changes, and each moved letter gets its own copy of the item. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DONE carries only the letters count, so the site memorial never shows a held count as something received; letters held for staff are listed by describe(). Labels name the writer's character, or say the letter predates recorded writers, instead of showing account or character UUIDs. The estate journal is written through the same durable path, folder flush included, and one failing estate no longer stops the hourly reconcile of the others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stage 6b (estates and wills, umbrella TF-Minecraft/RPCharacters#89): BirdMessenger becomes the
birdmessengerestate participant (design D8, R17, M7).Sending character. New letters record
senderCharacterIdin both serialisations, in-flightStoredMail(sender-character) and the pending letter maps, so it survivesaddPending. Queued letters also keep the mail's ID.Settle. For the testator's pending letters:
characterIdandownerUuid, to the heir and delivered as normal mail;senderCharacterIdand that character alive: back into its pending queue, delivered with "Returned: the recipient has died";returned_mail.yml), delivered at the account's next character session with "Returned";describe()(writer's character name, never a UUID) for/estate show; it goes back by itself if the writer is revived. DONE counts only movedletters.Each moved letter gets a stored ID first (saved before anything moves), and
estates/<deathId>.ymllists the IDs before the queue changes, so DONE always carries every moved ID (M12). A move is all or nothing: receiving queues are checked first, a failed save puts every queue back in memory and the participant answers RETRY. Mail files are written whole (temp, fsync, atomic move, folder fsync). The account queue is saved before the testator's queue drops a letter; load discards a copy left behind by a crash in between. In-flight letters are untouched; the hourly reconcile moves them once they land.Reconcile and probes. The participant registers after mail loads and only when TLibs has the estate API (
Class.forNameprobe), settles every decided estate on the first tick and hourly, and reports with the revision answered, only when the outcome changes. On TLibs 2.5.0,BirdMessenger,MailStoreandMailServiceload and verify without the estate classes; the plugin enables and logs that it does not take part.Pins TLibs 2.6.0, which is not released yet, so CI may fail resolving it until it is.
Docs: TF-Minecraft/Docs#220
Review. Muse's findings 1-6 are all addressed (5cf2d2b, 48784d5).
Tests.
tfmc-mvn -o -B --no-transfer-progress clean verify: 247 tests, 0 failures, JaCoCo line gate (0 missed) met. Behaviour tests cover the sending character through flight and the queue, ID assignment, heir moves, returns to the writing character and to the account, every held case, revival of a held writer, idempotent and cumulative settles, a late landing letter, the crash between the two files, damaged returned queues, failed hand-overs, journal failures, describe, change-only reporting, registration, the probe and enabling without the estate API.🤖 Generated with Claude Code