Skip to content

Fix reloading issues#24

Merged
simpros merged 5 commits intomainfrom
pr-19-anvil/fix-leads-bugs
Apr 5, 2026
Merged

Fix reloading issues#24
simpros merged 5 commits intomainfrom
pr-19-anvil/fix-leads-bugs

Conversation

@simpros
Copy link
Copy Markdown
Owner

@simpros simpros commented Apr 4, 2026

No description provided.

simpros and others added 5 commits March 25, 2026 15:11
Add <svelte:boundary> to the app layout to handle async pending/error
states for remote function queries. Without this boundary, pages using
$derived(await query()) would fail on full-page reload because there
was nothing to catch the pending state during hydration.

Fix lead deletion crash by using submit().updates() (single-flight
mutation with no queries) instead of bare submit(). The default
auto-invalidation was re-running getLeadData() for the just-deleted
lead, causing a 404 error before goto() could navigate away.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 12 new tests (263 total, 0 failures):

- Layout boundary structural tests (5): verify svelte:boundary exists
  with pending and failed snippets, and that children render inside it.
  Prevents accidental removal of the boundary.

- Lead detail page tests (7): verify page renders correctly, and
  critically test that deleteLead.enhance() calls submit().updates()
  (not bare submit()) to prevent auto-invalidation crash. Also tests
  navigation to /leads after delete and error handling on failure.

Enhance createFormMock to capture enhance callbacks via _enhanceCallback
property, and add issues() support to field proxy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ion tests

Replace _enhanceCallback hack with DOM-based interactions and remove all
as-any casts to satisfy @typescript-eslint/no-explicit-any. Make
addFormApi generic to preserve Mock type through Object.assign. Improve
layout structural guard tests with regex matchers and better comments.
@simpros simpros force-pushed the pr-19-anvil/fix-leads-bugs branch from d541921 to 5c9da16 Compare April 5, 2026 09:51
@simpros simpros merged commit f5d161a into main Apr 5, 2026
4 checks passed
@simpros simpros deleted the pr-19-anvil/fix-leads-bugs branch April 5, 2026 09:55
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

Successfully merging this pull request may close these issues.

1 participant