fix(web): ignore stale contract list responses #4

Merged
macoun merged 1 commit from fix/contract-list-stale-response into main 2026-10-16 08:57:23 +00:00
Owner

Summary

When the search text or filters change quickly, an older request can finish after a newer one.
Since #3 the late response overwrote the current filter state and the list stayed stuck on the spinner.

The list effect now drops responses that belong to filters that are no longer current
(cleanup flag in useEffect), so the last search always wins.

Testing

  • npm run lint, npm run build
  • Local harness with the first search delayed by 1.5 s: before the fix the list stays on the spinner,
    after the fix it shows the result of the latest search.
## Summary When the search text or filters change quickly, an older request can finish after a newer one. Since #3 the late response overwrote the current filter state and the list stayed stuck on the spinner. The list effect now drops responses that belong to filters that are no longer current (cleanup flag in `useEffect`), so the last search always wins. ## Testing - `npm run lint`, `npm run build` - Local harness with the first search delayed by 1.5 s: before the fix the list stays on the spinner, after the fix it shows the result of the latest search.
fix(web): ignore contract list responses for outdated filters
All checks were successful
Build and publish Docker image / test (pull_request) Successful in 1m44s
Build and publish Docker image / migrations-check (pull_request) Successful in 48s
Build and publish Docker image / frontend (pull_request) Successful in 47s
Build and publish Docker image / build-and-push (pull_request) Has been skipped
b16fa7b739
Since the list keeps its result together with the filter key, a late response for an older search replaced the newer one and the list stayed on the spinner until the filters changed again. The effect now drops responses from a previous run. Reproduced against a stubbed API with a slow older search; the fixed page shows the latest results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macoun merged commit 9163e6f971 into main 2026-10-16 08:57:23 +00:00
macoun deleted branch fix/contract-list-stale-response 2026-10-16 08:57:23 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
STATOTEST/contract-microservice!4
No description provided.