Skip to content

Fix(show/edit): Avoid a redirect loop when useGetOne returns an error in shadcn-admin-kit #10776

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

Merged
merged 2 commits into from
Jun 11, 2025

Conversation

jonathanarnault
Copy link
Contributor

@jonathanarnault jonathanarnault commented Jun 10, 2025

Problem

When a resource is not found in shadcn-admin-kit, there is an infinite loop caused by a race condition between the router navigation and the query refresh

Solution

Flush sync the navigation in useEditController and useShowController when the record fails to be retrieved.

How To Test

Perform the test in the shadcn-admin-kit with the updated code

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@djhi djhi merged commit b8d1878 into master Jun 11, 2025
15 checks passed
@djhi djhi deleted the fix/edit-redirect-loop branch June 11, 2025 06:57
@djhi djhi added this to the 5.8.4 milestone Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants