alibaba / alibaba/hooks

useInfiniteScroll: 未进行竞态处理,丢失了useRequest的竞态处理能力

Open
#2,676 2 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
15k
Forks
2.8k
Avg merge
15h 7m
Merged PRs (30d)
2

Description

在传给useRequest的异步函数中,传给useInfiniteScroll的service有结果后,就进行了setState状态更新。导致useRequest的竞态处理无效,不需要的数据也会被更新。

Contributor guide

Open the contributing guide

Research direction

Start by reading the useInfiniteScroll service flow and how it delegates race handling to useRequest. Reproduce overlapping requests and verify that an older result cannot update state after a newer result has completed.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.