Conversation
Fixes iyear#1149. When bulk forwarding from exported JSON, the same media file may appear multiple times. Add a --skip-same flag that skips messages whose media (document id+size or photo id) has already been forwarded in this run to the same destination peer/thread. Notes: - dedup is scoped per destination, so routing the same file to two different chats is not affected - messages without file media are never deduplicated - works within a single run; cross-run persistence is intentionally not implemented (stale state would silently drop legitimate re-forwards) - skipped messages are logged and counted in a final summary log
- add Skip Duplicates section to EN and ZH forward guide - comment why albums are deduplicated as a whole and why dedup applies to dry-run too
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.
Proposal
Fixes #1149.
When bulk forwarding from exported JSON files, the same media file may appear multiple times (overlapping exports, cross-posted documents, ...), and every occurrence gets forwarded again. This PR adds a
--skip-sameflag totdl forward, mirroring the existing flag intdl dl.Behavior
id + sizeidpeer id + thread + media key): routing the same file to two different chats is intentionally not affected.skipped duplicated messages count=N).--dry-run, so the preview matches what a real run would send.Design notes
dl(where the destination filesystem provides durable truth), forward would need local bookkeeping that can go stale (e.g., destination chat cleaned up), silently dropping legitimate re-forwards. Happy to discuss if maintainers prefer persistent KV-based dedup.Verification
go build,go vet,gofmt: cleango test -race ./app/forward/...: green (new unit tests for media fingerprinting)golangci-lint run app/forward/... cmd/...: 0 issuestdl forward --helpshows the new flag