Repository navigation
Backfill workbench messages into participants' mailboxes (CL-7454) - #650
Closed
TheGreatAxios wants to merge 4 commits into
Closed
TheGreatAxios wants to merge 4 commits into
TheGreatAxios wants to merge 4 commits into
Conversation
Unit tests over in-memory fakes for the cursor/paging logic and the author-aware fan-out (human outbound/inbound, agent inbound-only), plus a DB-gated integration test replaying a three-message thread (person, agent, person) in a two-human workbench against a real @corbits/mailbox schema, proving the parent links and that a second pass writes nothing.
CL-7450 wired the live send path to fan a new message into every human
participant's @corbits/mailbox inbox as it is posted; nothing wrote a
mailbox copy of a message posted before that landed, and nothing
retroactively fills the gap for a workbench that has been quiet since.
runMailboxBackfillPass (packages/chat/src/mailbox-backfill.ts) is that
fill: a per-workbench replay that walks workbench_messages oldest-first,
mints and stamps mail_message_id for any row that predates CL-7104, and
writes the same author-aware mailbox rows a live send would have — an
outbound copy for a human author, an inbound copy for every other human,
and inbound-only copies for an agent-authored row (an agent has no
mailbox of its own). A workbench with no human participant is skipped
and reported. Idempotent by @corbits/mailbox's own default transport key,
with a per-workbench progress cursor (new chat.mailbox_backfill_cursor
table, migration 0030) as a courtesy on top so a rerun resumes rather
than re-walking history. Every written row carries an extra
{ kind: "import", id: "chat-backfill" } ref, since @corbits/mailbox's
priority/classification/status columns are the mount boundary's own
vocabulary rather than something this package can stamp a value into.
Wired into apps/hub/src/index.ts as a one-shot, fire-and-forget boot
step beside the other mailbox sweeps, reusing the exact mailbox dep the
live send path fans out through so a backfilled row and a live-sent row
are addressed and idempotency-keyed identically.
Documents runMailboxBackfillPass — what it replays, its idempotency and cursor story, the import-ref marker choice, and its boot wiring — plus that the whole module is meant to be deleted once workbench_messages itself is retired.
Contributor
Author
|
Closed: owner ruled a hard cutover, no backfill of existing workbench messages into mailboxes (CL-7454 canceled). The thread-backed timeline lands with the old tables dropped. |
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.
Fixes CL-7454
Part of CL-7445