Skip to content

invalidateAll incorrectly resets page.form #13825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
KTibow opened this issue May 25, 2025 · 0 comments
Open

invalidateAll incorrectly resets page.form #13825

KTibow opened this issue May 25, 2025 · 0 comments

Comments

@KTibow
Copy link
Contributor

KTibow commented May 25, 2025

Describe the bug

form isn't supposed to be reset when calling invalidateAll. the form you get as a prop isn't reset, and the code explicitly says Reset form on navigation, but not invalidation. and yet, the form from $app/state's page is.

Reproduction

https://github.com/KTibow/sveltekit-invalidateall-issue

click add, then click remove, and note that the page.form ones were incorrectly turned into null

Logs

System Info

System:
    OS: Linux 6.14 Ubuntu 25.04 25.04 (Plucky Puffin)
    CPU: (12) arm64 unknown
    Memory: 4.00 GB / 14.20 GB
    Container: Yes
    Shell: 4.0.1 - /usr/bin/fish
  Binaries:
    Node: 23.11.0 - ~/.local/share/pnpm/node
    npm: 10.9.2 - ~/.local/share/pnpm/npm
    pnpm: 10.11.0 - ~/.local/share/pnpm/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^6.0.0 => 6.0.1
    @sveltejs/kit: ^2.16.0 => 2.21.1
    @sveltejs/vite-plugin-svelte: ^5.0.0 => 5.0.3
    svelte: ^5.0.0 => 5.33.2
    vite: ^6.2.6 => 6.3.5

Severity

serious, but I can work around it

Additional Information

claude thinks this change to get_navigation_result_from_branch would fix it (seems to fix my specific repro)

-			form: form ?? null,
+			form: form !== undefined ? form : page.form,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant