sveltejs / sveltejs/kit

Refreshing `query()` chained to `command().updates()` doesn't update `.loading` state

Open
#14,536 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-decision
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

as described in https://svelte.dev/docs/kit/remote-functions#command-Updating-queries, we can chain a query refresh that is scheduled to run after the command has finished. This works well, and is a great feature.

However, it does not set the .loading state of that query to true.

Now I don't know if this is by design, because we are technically not refreshing the query at that time, only after the command / with it, but to me that doesn't seem intuitive.

If some part is about to update, I would like to be able to show that using the .loading property in this case.

Reproduction

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

Logs

System Info
System:
    OS: macOS 26.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 1.45 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.8.0 - /opt/homebrew/bin/node
    npm: 11.6.0 - /opt/homebrew/bin/npm
    bun: 1.2.22 - ~/.bun/bin/bun
  Browsers:
    Chrome: 140.0.7339.187
    Safari: 26.0
  npmPackages:
    @sveltejs/adapter-node: ^5.3.2 => 5.3.2
    @sveltejs/kit: ^2.43.4 => 2.43.4
    @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1
    rolldown-vite:  7.1.13
    svelte: ^5.39.6 => 5.39.6
Severity

serious, but I can work around it

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction in src/routes/+page.svelte from the linked StackBlitz example, then trace the query().updates() behavior described in the remote-functions documentation. Confirm when the chained refresh runs and add coverage showing that the query's .loading state becomes true during the update.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.