Skip to content

Abort stale dashboard requests on filter change and drawer close - #838

Open
Gadflyxx wants to merge 1 commit into
StellarGateLabs:mainfrom
Gadflyxx:drips/681
Open

Gadflyxx wants to merge 1 commit into
StellarGateLabs:mainfrom
Gadflyxx:drips/681

Conversation

@Gadflyxx

Copy link
Copy Markdown

Summary

Abort stale dashboard requests on filter change and drawer close

What was solved

#681 — Dashboard: cancel stale requests with AbortController

Add AbortController-based cancellation to the dashboard so that changing filters aborts the in-flight list request and closing the drawer aborts the in-flight detail request, preventing stale responses from overwriting newer results.

Addressed:

  • Changed: static/state.js
  • Abort the in-flight list request when filters change
  • Abort the detail request when the drawer closes
  • Must work in current Chrome, Firefox and Safari at desktop and mobile widths

Changes

  • static/state.js (modify)

Approach

  1. In static/dashboard.js, introduce a per-request AbortController for the list fetch: store it in a module-level variable, abort the previous controller before starting a new list request when filters change, and ignore AbortError in the catch handler.
  2. In static/dashboard.js, add a separate AbortController for the detail fetch: abort it when the drawer closes (and before opening a new detail), and swallow AbortError so no spurious error UI appears.
  3. Ensure aborted requests do not overwrite newer results (guard state updates after await) and that no API key is added to URLs, logs, or console output.
  4. Verify tests/dashboard_asset_tests.rs expectations (fetch call patterns, asset string contents) remain satisfied by the new code.
  5. Keep changes limited to dashboard request cancellation; do not refactor unrelated dashboard code or backend endpoints.

Issues

Closes #681

@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@Gadflyxx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Dashboard: cancel stale requests with AbortController

1 participant