Skip to content

fix: prevent duplicate running status requests#175

Merged
cxymds merged 1 commit into
mainfrom
cxymds/fix-running-status-duplicate-requests
Jul 21, 2026
Merged

fix: prevent duplicate running status requests#175
cxymds merged 1 commit into
mainfrom
cxymds/fix-running-status-duplicate-requests

Conversation

@cxymds

@cxymds cxymds commented Jul 21, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

Prevent the Running Status page from issuing an initial request batch that is immediately canceled and repeated.

The duplicate traffic had two causes:

  • route changes recreated the shared API client because the current pathname was part of its initialization effect dependencies;
  • React Strict Mode's effect preview launched status and admin requests before the preview cleanup ran.

The API client now remains stable across dashboard navigation while the 403 handler reads the latest pathname through a ref. Initial status and admin requests are deferred to a cancelable microtask so Strict Mode preview effects do not reach the network.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm install --frozen-lockfile
pnpm tsc --noEmit
pnpm lint
pnpm prettier --check .
pnpm test:run
git diff --check

All 338 tests pass.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

N/A

Screenshots (if applicable)

N/A — request lifecycle behavior only; no visual changes.

Additional Notes

The existing timeout, refresh interval, visibility refresh, request abort, and stale-response protection behavior remains unchanged.

@cxymds
cxymds marked this pull request as ready for review July 21, 2026 01:09
@cxymds
cxymds merged commit 102114f into main Jul 21, 2026
10 checks passed
@cxymds
cxymds deleted the cxymds/fix-running-status-duplicate-requests branch July 21, 2026 01:12
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