Skip to content

Enhanced forms should make one request when submitted, not two #16691

Closed as not planned

Description

@ldhenk

Describe the bug

I'm working on an application written with SvelteKit that makes heavy use of Form Actions and use:enhance. Unfortunately, every form submission feels extra sluggish in large part because it triggers two round trips in sequence: the form submission itself followed by a subsequent invalidateAll. This approximately doubles the apparent slowness on high-latency connections.

Instead, the newly updated page data should be included in the response to the initial form submission, so that only a single round trip is required. This is already what happens when the form is submitted with javascript disabled, so it's unfortunate that trying to enhance the form submission UX in fact significantly degrades it in this way.

I don't know whether the svelte team classifies performance issues like this as bugs, so apologies if I've chosen an inappropriate label.

Reproduction

https://github.com/ldhenk/sveltekit-doublereq-demo

  • Run project
  • Open dev tools and enable throttling
  • Click the button
  • Observe two requests complete in sequence before the count increments

Logs

System Info

N/A

Severity

serious, but I can work around it

Additional Information

No response

Activity

  1. teemingc commented on Aug 8, 2026

    @teemingc
    Member

    I don't know if we'll work on this as this is superseded by the form remote function that does this https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations

  2. ldhenk commented on Aug 8, 2026

    @ldhenk
    Author

    I don't know if we'll work on this as this is superseded by the form remote function that does this https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations

    Oh, that is unfortunate. Am I understanding correctly that I will need to wait until remote functions are stabilized and then re-write all of my forms/actions to use them?

  3. Nic-Polumeyv commented on Aug 8, 2026

    @Nic-Polumeyv
    Member

    although remote functions are experimental, they are almost certainly something you should consider slowly transitioning to at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions