-
Notifications
You must be signed in to change notification settings - Fork 33
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: clear stale errors #153
Conversation
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.
I'd also add a test for this new behavior
There's a test in the parent SDK testing the behavior of the event system internals. |
@FredrikOseberg I meant the flag clearing part only, not the underlying logic. But I leave it up to you to decide if it's worth the effort |
We could. The reason I left it out is because such a test will basically just test the setState functionality of react and event listener functionality, which is already quite heavily tested by those frameworks. |
@@ -50,7 +50,7 @@ | |||
"react-dom": "^18.2.0", | |||
"react-test-renderer": "^18.2.0", | |||
"typescript": "^5.3.2", | |||
"unleash-proxy-client": "^3.2.0", | |||
"unleash-proxy-client": "^3.3.0-beta.1", |
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.
This was missed off the changelog! :P
This PR fixes a bug where errors would not be cleared out and kept in state.
How
In the parent SDK we emit a 'recovered' event when the network call is successful following an errored HTTP call. In this SDK we listen to the recover event and set the error state to
null
.