-
-
Notifications
You must be signed in to change notification settings - Fork 235
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: Multiple FlutterError.onError calls in FlutterErrorIntegration #345
Conversation
When doing multiple close/init on the SDK, multiple FlutterErrorIntegration instances were intantiated during application lifetime. Every one of them would replace FlutterError.onError function and reference the previouse one. This resulted in a chained call, where errors were reported multiple times.
@marandaneto @bruno-garcia Thanks for the detailed feedback, i incorporated the feedback and added one additional test. Should we also change something based on the noop suggestion from @bruno-garcia? |
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.
LGTM
@denrase looks like |
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.
left a note about testing but other than that, LGTM.
thanks for fixing this.
Ok, so apparently with Flutter >=
I'm not sure if we can ignore this warning, or if users will now run into issues when running on simulator. Do you have any suggestions @marandaneto? Think we should do this in a separate issue? |
📜 Description
Hold the a static reference to the default
FlutterError.onError
inFlutterErrorIntegration
and restore it in integrationsclose()
method.💡 Motivation and Context
When doing multiple close/init on the SDK, multiple
FlutterErrorIntegration
instances are instantiated during application lifetime. Every one of them would replaceFlutterError.onError
function and reference the previous one. This resulted in a chain of calls, where errors were reported multiple times.💚 How did you test it?
📝 Checklist
🔮 Next steps