Skip to content

Redirect and single-flight mutations #15726

@Stadly

Description

@Stadly

Describe the bug

When a remote form function rehreshes a query and then redirects, the query is fetched again after the redirect (if it is used on that page). I would have exptected it to use the fresh data retured from the form function after the redirect. If not, I guess there is no way to do single-flight mutation when using redirect.

Reproduction

https://www.sveltelab.dev/5uaeob2ogwsg968?files=.%2Fsrc%2Flib%2Fdata.remote.js

  1. Click edit
  2. Submit the form
  3. Notice the network traffic:
remote (contains data):
refreshes: "[{\"1t2evzh/data/\":1},{\"type\":2,\"data\":3},\"result\",3]"

data (is fetched anyway):
result: "[3]"
type: "result"

Logs

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: 22.22.0 - /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: ^3.0.0 => 3.3.1 
    @sveltejs/kit: ^2.5.27 => 2.57.1 
    @sveltejs/vite-plugin-svelte: ^5.0.0 => 5.1.1 
    svelte: ^5 => 5.55.4 
    vite: ^6.0.0 => 6.4.2

Severity

annoyance

Additional Information

No response

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