-
Notifications
You must be signed in to change notification settings - Fork 253
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
fix(clerk-js): Clear feedback when undefined
is passed to setError
#2399
Conversation
We still have a lot of places in clerk-js where we call `setError(undefined)` instead of `clearFeedback`
🦋 Changeset detectedLatest commit: e5571d4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
a721cc8
to
e5571d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Searching for setError()
in project i found that it's being called inside a promise catch()
block in packages/clerk-js/src/ui/hooks/useFetch.ts
. Is this intentional? Should we at least show a console.error
?
I would suggest instead of calling setError()
without args we could introduce a clear()
method to unset the errors and the loading state or anything else related. By doing this, the intention of the action we want to do will be more clear.
@dimkl I totally agree, this is my plan, but because this require a bit of refactoring and i don't want to mess too much with v4, shall we let this one be backported and make a new one with the proper refactoring ? Btw you are referring to a different |
@panteliselef let's proceed. |
Description
We still have a lot of places in clerk-js where we call
setError(undefined)
instead ofclearFeedback
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/clerk-expo
@clerk/fastify
gatsby-plugin-clerk
@clerk/localizations
@clerk/nextjs
@clerk/clerk-react
@clerk/remix
@clerk/clerk-sdk-node
@clerk/shared
@clerk/themes
@clerk/types
build/tooling/chore