Skip to content
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

Merged
merged 1 commit into from
Dec 1, 2023
Merged

fix: clear stale errors #153

merged 1 commit into from
Dec 1, 2023

Conversation

FredrikOseberg
Copy link
Contributor

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.

Copy link
Contributor

@kwasniew kwasniew left a 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

@FredrikOseberg
Copy link
Contributor Author

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.

@kwasniew
Copy link
Contributor

kwasniew commented Nov 29, 2023

@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

@FredrikOseberg
Copy link
Contributor Author

@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.

@FredrikOseberg FredrikOseberg merged commit c5e34e3 into main Dec 1, 2023
4 checks passed
@FredrikOseberg FredrikOseberg deleted the fix/clear-stale-errors branch December 1, 2023 11:58
@@ -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",

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

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.

3 participants