Skip to content

fix(toast-load): infinite load of adding a card on a collection page#704

Open
tylersayshi wants to merge 1 commit intocosmik-network:mainfrom
tylersayshi:fix-infinite-load
Open

fix(toast-load): infinite load of adding a card on a collection page#704
tylersayshi wants to merge 1 commit intocosmik-network:mainfrom
tylersayshi:fix-infinite-load

Conversation

@tylersayshi
Copy link
Copy Markdown

Adding a card from a collection page shows 'Adding card...' forever. The collection page's <Suspense> boundary re-suspends on query invalidation, unmounting the component before.

React Query can fire the mutate-level onSuccess/onError callbacks that update the toast. This PR moves toast handling from mutate-level callbacks into definition-level callbacks on useMutation, which always fire regardless of component mount state.

I updated the docs and iframely service a bit from dev'ing on this as someone without any secrets or desire to fully run the backend.

thanks again for semble! this stuff is awesome.

Adding a card from a collection page shows 'Adding card...' forever. The collection page's `<Suspense>` boundary re-suspends on query invalidation, unmounting the component before React Query can fire the mutate-level `onSuccess`/`onError` callbacks that update the toast.
Moved toast handling from mutate-level callbacks into definition-level callbacks on `useMutation`, which always fire regardless of component mount state.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

@tylersayshi is attempting to deploy a commit to the Cosmik Team on Vercel.

A member of the Team first needs to authorize it.

@tylersayshi
Copy link
Copy Markdown
Author

some js lib tool notes as an aside (feel free to disregard):

  • pnpm is much nicer to use than npm (the cli) - it's --parallel flag would help make some of your package.json scripts nicer/cleaner imo https://pnpm.io/cli/run#--parallel
  • vitest is much faster and less buggy than jest from my experience. jest has always led my projects to a doomed destiny of memory leaks and 20min CI jobs 😅

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