Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider cancelled requests #50

Merged
merged 2 commits into from May 16, 2024
Merged

consider cancelled requests #50

merged 2 commits into from May 16, 2024

Conversation

mikevinmike
Copy link
Contributor

should resolve issue #21

stop propagating cancelled requests to axios
do not count cancelled requests in for the rate limit
@petrkotek
Copy link

BUMP - @aishek, can you please consider merging this?

I can confirm that this resolves my issue with 'lagging' auto-completion when I use rate limiting & cancel queued requests. (Thanks @mikevinmike! ❤️)

// First, cancel in-progress requests as the previous suggestions no longer matter.
    this.suggestAddressesCancelTokenSource?.cancel()
    this.suggestAddressesCancelTokenSource = axios.CancelToken.source();

    // Issue the new request.
    return this.http.get(API_URL + '/suggest_addresses', {
      params: { query },
      cancelToken: this.suggestAddressesCancelTokenSource.token
    })

@aishek aishek self-assigned this May 15, 2024
@aishek aishek added the bug Something isn't working label May 15, 2024
@aishek aishek merged commit 734cc83 into aishek:master May 16, 2024
@aishek
Copy link
Owner

aishek commented May 16, 2024

Well, it is better later than never. Thanks!

@aishek
Copy link
Owner

aishek commented May 20, 2024

Published in version 1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants