Skip to content

Nested remote query functions in each loop freeze page when quickly refreshing queryΒ #15083

@hrueger

Description

@hrueger

Describe the bug

Hi, I ran into a bug where my page using remote query functions would just freeze. In the dev tools I can see that ram usage is exploding. This happens when you

  • have an each loop driven by a remote function
  • use another remote function inside the loop's items
  • Call .refresh twice quickly after each other, even though they are awaited. In my real app I'm listening to websocket events and when I receive an event or the user clicks refresh, I call query.refresh. Therefore, I can't ensure that this does not happen multiple times. Debouncing could help, but it still is a bug ;-)

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-bng3t2tw?file=src%2Froutes%2F%2Bpage.svelte

Please note that hmr is disabled in this reproduction, because otherwise we run into #15066, which has a similar outcome (page freeze).

Logs

no errors, the page just freezes.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^7.0.0 => 7.0.0 
    @sveltejs/kit: ^2.49.2 => 2.49.2 
    @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1 
    svelte: ^5.46.0 => 5.46.0 
    vite: ^7.3.0 => 7.3.0

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions