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

Infinite fetch loop with AjaxBar, XMLHttpRequest and watchEffect (or asyncComputed) #16767

Closed
Dimava opened this issue Jan 12, 2024 · 1 comment · Fixed by #16780
Closed

Infinite fetch loop with AjaxBar, XMLHttpRequest and watchEffect (or asyncComputed) #16767

Dimava opened this issue Jan 12, 2024 · 1 comment · Fixed by #16780
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@Dimava
Copy link
Contributor

Dimava commented Jan 12, 2024

What happened?

Same as #10780 I've encountered problems with Axios inside asyncComputed(vueuse) causing infinite loop with AjaxBar on

I had a guess that this is not caused by Axios itself and tried to reproduce it without Axios

What did you expect to happen?

QAjaxBar to not cause infinite request loop when using XMLHTTPRequest

Reproduction URL

https://codepen.io/dimava/pen/YzgpVOW

How to reproduce?

Synchronously create new XMLHttpRequest() and .open(...) it inside a watchEffect watcher

    watchEffect(async () => {
      let xhr = new XMLHttpRequest();
      xhr.open('GET', 'https://jsonplaceholder.typicode.com/todos');
      xhr.send();
    });

This will cause infinite fetch loop every second, caused by onScreen.value being read synchronously inside start and thus being recorded as a dependency by watchEffect

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Plugins (quasar)

Platforms/Browsers

Chrome, Microsoft Edge

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@Dimava Dimava added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Jan 12, 2024
@github-actions github-actions bot added area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Jan 12, 2024
Dimava added a commit to Dimava/quasar that referenced this issue Jan 17, 2024
rstoenescu pushed a commit that referenced this issue Jan 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(QAjaxBar): fix infinite fetch loop in watchEffect

closes #16767
@rstoenescu
Copy link
Member

Fix will be available in Quasar 2.14.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants