Skip to content

fix(qbittorrent): guard against stale pagination responses - #82

Open
jeromelefeuvre wants to merge 1 commit into
Shoshuo:mainfrom
jeromelefeuvre:fix/qbittorrent-pagination-race
Open

fix(qbittorrent): guard against stale pagination responses#82
jeromelefeuvre wants to merge 1 commit into
Shoshuo:mainfrom
jeromelefeuvre:fix/qbittorrent-pagination-race

Conversation

@jeromelefeuvre

@jeromelefeuvre jeromelefeuvre commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • refreshData() aborts the previous in-flight fetch before firing a new one, but abort() is a no-op once a response has already arrived — common on localhost, where the round-trip can beat the click-to-JS-execution delay.
  • A periodic poll response for the old page could land after a user's page-change click and silently snap the view back to the previous page.
  • Adds a sequence counter so a response is only applied if no newer request has been issued since, regardless of whether abort() actually worked.

Test plan

  • Open the qBittorrent torrents page with several pages of results
  • Click to page 2/3 repeatedly right as the periodic auto-refresh would be ticking, confirm the page no longer snaps back to page 1
  • make lint-twig passes on the changed template

🤖 Generated with Claude Code

refreshData() aborts the previous in-flight fetch before firing a new
one, but abort() is a no-op once a response has already arrived —
common on localhost, where the round-trip can beat the
click-to-JS-execution delay. A periodic poll response for the old
page could then land after a user's page-change click and silently
snap the view back to the previous page.

Add a sequence counter so a response is only applied if no newer
request has been issued since, regardless of whether abort() worked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jeromelefeuvre
jeromelefeuvre force-pushed the fix/qbittorrent-pagination-race branch from 4d84db8 to 4d16c6e Compare July 28, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant