Skip to content

fix(web): prevent spurious 'Failed to fetch' toast when switching brand tabs - #257

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
gitbasitmalik:fix/spurious-toast-brand-tabs
Jun 16, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
gitbasitmalik:fix/spurious-toast-brand-tabs

Conversation

@gitbasitmalik

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an issue where rapidly switching between the Topics, Prompts, and Settings tabs triggers a red "Failed to fetch" toast. The fix uses a cancellation flag (abort guard) within the useEffect cleanup function. By passing this flag to the async data loaders, we prevent the generic error toast from firing when Next.js naturally aborts the network requests during component unmount/navigation.

Related issue

Closes #227

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@gkhngyk
gkhngyk merged commit c5feda6 into ansvisor:main Jun 16, 2026
2 checks passed
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.

fix(brands): spurious 'Failed to fetch' toast when switching brand detail tabs quickly

2 participants