Skip to content

Preflight issues don't update on remote function form during subsequent submissions #15181

@dr-starchildren

Description

@dr-starchildren

Describe the bug

When using preflight() on a remote function form, we want to be able to access the results, so we can show a toast message (or other effect). While, we can check the form using onsubmit and tick(), there's a bug after an error has been added to the form's issues.

For the initial submission if we enter correct data or incorrect data, everything works as expected. However, if we had entered incorrect data the first time, then all subsequent submissions still have 'issues' on the form, even when the data is valid.

For example:
First entry: a (invalid)
Second entry: abc (valid)

Using .validate() doesn't resolve the issue. If using an .enhance(), the behavior occurs there as well.

Expected behavior: When using preflight if incorrect data is entered the first time, on a future submission where the data is valid the form should submit correctly.
Actual Behavior: After having incorrect data on the form, the 'issues()' does not update for preflight.

Initial discord discussion:
https://discord.com/channels/457912077277855764/1460579385970000037

Reproduction

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

Logs

System Info

https://stackblitz.com

Severity

annoyance

Additional Information

No response

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