Repository navigation
fix(dashboard): cancel obsolete API requests at the HTTP transport - #852
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. Walkthrough
ChangesRequest cancellation
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to Requests can now be canceled when they become obsolete, while active requests continue normally. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit sends a signal bright Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
# Conflicts: # dashboard/src/service/http.ts
|
Note Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
🤖 Coding Agent task started for unit test generation. |
|
Thanks, merged. Forwarding the signal was exactly what was missing for TanStack Query's cancellation to reach the network, and we confirmed in a browser that superseded requests are now aborted with no error toast. Your #857 carries the same hunk, so it should merge cleanly on top. |
… to ff6e596 Every Port queue line in the panel and side-repository ledgers now says `security: yes` or `security: no`. Security: c9b445a (passkey client rename), eb50bfd, PasarGuard#938, PasarGuard#940, PasarGuard#942, the cryptography 50.0.2 security release, and the ten commits of upstream's PasarGuard#979 permission-leak batch (user list scopes, API-key permissions, HWID visibility, users.read, the Telegram inline search), which no branch ports yet. Checked with git ls-remote on 2026-10-09: upstream dev moved to ff6e596. The PasarGuard#979 batch, the node RPC fixes (PasarGuard#977, PasarGuard#978), the core-deletion restart (PasarGuard#934), dashboard fixes (PasarGuard#852, PasarGuard#907, PasarGuard#949, PasarGuard#952), performance changes (PasarGuard#945, PasarGuard#853, PasarGuard#855) and the merged dependabot bumps (ruff, uvloop, fastapi) join the queue; the ruff and uvloop conditional waivers ended when upstream merged them. Waived: PasarGuard#980 and its branch commit (the Telegram notifier workflow the fork deleted) and the superseded fastapi dependabot head b021d6f. The refs snapshot records the five new heads. Fork core-kit main 90701408 now contains upstream d2ecb5bd, so that ledger is empty. No side repository gained an upstream commit since 2026-10-07.
…asarGuard#852) Co-authored-by: etm <etm@LAPTOP-62O1BVSJ> (cherry picked from commit 38ae43e)
Summary
Pass the generated client's
AbortSignalthroughorvalFetchertoofetch. When a user changes search/page parameters or leaves a screen, TanStack Query already cancels the obsolete query, but the HTTP adapter previously discarded its signal and let the network request finish.The latest active request still completes normally. This fixes the shared transport used by generated API queries with a two-line change.
Before / after
Local integration comparison against
dev(234ab68c), using the actual generatedgetGetUsersQueryOptions, TanStackQueryObserver,orvalFetcher, andofetchwith a loopback HTTP server:For each search key, the harness waited until its request reached the server before switching keys. Responses were held until all 10 requests had started. Each response body was 65,575 bytes of synthetic JSON. Cancellation was measured using premature HTTP response-close events, not just canceled query state. The search scenario sent 90% fewer response body bytes in this controlled test; this is not a production performance estimate.
Type of change
Checklist
Testing
git diff --check: passed.node node_modules/typescript/bin/tsc -p tsconfig.app.json --noEmit --pretty false(fromdashboard): fails on existing project diagnostics. A TypeScript compiler API comparison found the same 28 diagnostics before and after, with none insrc/service/http.ts.Suggested manual browser check (not run): throttle the network in DevTools, change user search/page parameters while a request is pending, and check that obsolete requests show as canceled while the final request succeeds. Navigate away with a request pending and check that it is canceled as well.
Screenshots
Not applicable; no visual UI changes.
Notes for reviewers
This forwards the existing optional signal without changing the generated API file or other request options. It is independent of the user/node usage aggregation PRs. HTTP cancellation does not guarantee that backend or database work which has already started is interrupted.
Summary by CodeRabbit