Skip to content

Shared torrents: a deleted request that is still seeding doesn't count, and a cancelled one keeps the torrent forever #545

Closed

Description

@kikootwo

When two requests share one torrent (a re-request of the same book, a series pack), ReadMeABook checks the other requests before it removes the torrent. That check gets two cases wrong:

1. A deleted request that is still seeding doesn't count. Deleting a request whose finished torrent hasn't met its seeding rule keeps the torrent until it has, then removes it. But otherActiveRequestsUsingTorrent (src/lib/utils/shared-torrent.ts) only looks at requests that aren't deleted. So if another request using the same torrent is deleted, or the seeding cleanup finishes with it, the torrent is removed even though the first request's seeding time isn't done. On a tracker with a seeding rule that can count as a hit-and-run.

2. A cancelled request keeps the download forever. The seeding cleanup treats every other request on the torrent as a reason to keep it unless that request is finished and its own seeding rule is met. A cancelled request is never finished, so a torrent shared with a cancelled request is never cleaned up.

Expected:

  • A deleted request that is still waiting out its seeding time keeps the torrent until its own seeding rule is met, in both the request delete and the seeding cleanup.
  • A cancelled request doesn't keep a torrent that every other request is done with.

The cancel work for #228 and the cancelled-request cleanup from #506 handle both cases for requests cancelled after that change lands. This issue covers the request delete path, the existing seeding cleanup, and requests cancelled before it.

Activity

  1. added a commit that references this issue on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ReleasedbugSomething isn't workingdev-completedev work is completed, being tested or awaiting release

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions