Repository navigation
Conversation
Print ordered cleanup batches for a public key and community using a read-only database snapshot. Keep this diagnostic path separate from deletion execution. Co-authored-by: maincourse <37ce551b493d4a998caf030929c47bce0b6a0e43f1178b3a63c4151d7c16b76e@buzz.block.builderlab.xyz> Signed-off-by: Ravneet Arora <rarora@squareup.com>
This branch has not been deployed
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.
Summary
Add an operator command that prints every proposed human-content cleanup batch for an npub or hex public key in one community. This lets operators inspect which records would be removed before adding deletion execution.
The command uses a read-only connection and database snapshot. It does not create requests, change progress or delete data. Batches contain at most 100 exact row operations, with dependent records before their parents. The iterator fills batches across events and tables using an in-memory simulation.
The output ends with
preview_completeonly after the declared scope is exhausted. It lists excluded event kinds and flags media or active work. Thread repairs are reported separately; their mutations are not simulated. Relay-authored history requires--relay-pubkey. See usage and scope.Related issue
Related to #8698. This is a standalone read-only diagnostic on main, with no dependency on that unmerged deletion handler. No matching preview issue found.
Testing
Ran the actual command against an isolated PostgreSQL fixture using an npub. Its 105 reactions produced 315 items in batches of 100, 100, 100 and 15. The target message remained outside the deletion plan. Database fingerprints matched before and after; a second run printed identical output. An item-limit failure returned an error without a completion marker or database changes.
Human testing against the intended npub remains pending; keep this PR in draft. With
DATABASE_URLpointing to the database to inspect, run the command above and check the batch items and final completion record. No real user preview has been run for this PR.Repository-wide local gates are not green.
just ciandjust testwere attempted; toolchain issues and existing agent-test timing failures occurred. The remaining broad runs were stopped after the handler checks passed. This draft skips the repeated Rust and desktop pre-push test lanes; it retains branch and file-size checks. Full repository validation remains pending.Generated with Codex