Skip to content

Fix archiving of nested thread descendants - #3272

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-incomplete-thread-archiving-thr_x6cqzc745y
Sep 8, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-incomplete-thread-archiving-thr_x6cqzc745y

Conversation

@ymichael

@ymichael ymichael commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Archiving a thread and its children collected only immediate children and hidden source forks. Archiving each child then released its unarchived children, leaving grandchildren active and detached from their parents.

What changed

Collect the descendant tree before archiving, then archive children before their parents. Traverse archived hierarchy intermediaries, include hidden source forks at each level, and deduplicate threads reached through both relationships. Preserve parent relationships and leave unrelated threads and visible source forks untouched.

How you verified

Added public API regression coverage for four hierarchy levels, hidden forks with children, duplicate relationships, and an already-archived intermediary. The nested regression failed before the fix. All 17 tests in the selected suites pass afterward.

  • pnpm exec turbo run test --filter=@bb/server -- test/public/public-thread-parenting.test.ts test/threads/archive-pruned-environment.test.ts
  • pnpm exec turbo run typecheck --filter=@bb/server
  • git diff --check

AGENT GENERATED

@ymichael
ymichael merged commit cb3aaf5 into main Sep 8, 2026
16 checks passed
@ymichael
ymichael deleted the bb/fix-incomplete-thread-archiving-thr_x6cqzc745y branch September 8, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant