Skip to content

[bug useRequest] runAsync does not respect throttle options while run works correctly #2898

@whatwg6

Description

@whatwg6

Describe the bug

When using throttleWait with throttleLeading: true and throttleTrailing: false, the run method correctly respects the throttle configuration, but runAsync ignores it and sends all requests.

Steps To Reproduce

The current behavior

404
404
404
404
404
404
404-2 

runAsync is called multiple times and all requests are sent, ignoring the throttle settings.

The expected behavior

404
404-2

runAsync should behave the same as run - only the first call within the throttle window should execute (due to throttleLeading: true), and subsequent calls within 3 seconds should be ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions