Repository navigation
Conversation
lanjak
force-pushed
the
fix-7340-retention-sweep
branch
from
November 24, 2026 01:03
ac90674 to
ff666fb
Compare
Contributor
|
This is an automated message. We have closed this pull request because it has been open for more than two weeks. |
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.
Human comments
What was wrong
The storage-retention sweep read every thread (
readThreads) again before it acted on each archive, cold storage or delete group. A sweep of up to 50 groups per action read every thread about 150 times (#7340).What changed
plugins/storage-retention/src/service.ts:experimental_listCascadefor the root gives the threads core would also archive or delete, including threads created after the snapshot. Cold storage deletes the thread, so it uses thedeletecascade.readThreadsById) gets the root, the group members and the cascade threads. If the fresh root has a parent or source outside that set, a second by-ID read gets them.selectCandidatesruns again. The group is skipped if it is no longer eligible.coldStorage.store.experimental_listCascadeleaves out hidden threads, but core's archive includes them (for example a side chat on the root). A new thread that points at a cold storage candidate as its source is also not in the cascade. So the service listens forthread.created, and the sweep reads every thread again before the next group when a thread was created after the snapshot. It also reads every thread again when the snapshot is 60 s old.A sweep now makes one full read plus two small calls per group, unless threads are created during the sweep.
No wire, CLI or settings change.
How you verified
New tests in
plugins/storage-retention/src/retention.test.ts:thread.createdrefresh.Existing tests now use a
threads.listfake that appliesthreadIds, and the cold storage sweep tests have a cascade fake. The pinned and unarchived-after-selection test still passes.pnpm exec turbo run typecheck test lint lint:type-aware --filter=bb-plugin-bb--storage-retentionpasses (116 tests).oxfmt --checkpasses.Fixes #7340