You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shared torrents: a deleted request that is still seeding doesn't count, and a cancelled one keeps the torrent forever #545
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
chore: the #545 e2e spec type-checks (#573)