-
Notifications
You must be signed in to change notification settings - Fork 74
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
Trigger dispose before onClose in BaseController #2957
base: refactor
Are you sure you want to change the base?
Conversation
This PR has been deployed to https://linagora.github.io/tmail-flutter/2957. |
@override | ||
void onClose() { | ||
super.onClose(); | ||
dispose(); |
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.
Please test again on web
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.
The only place we have concern about dispose()
callback is ComposerController
, so it's fine
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.
Many controllers inherit from it. Are you sure other controllers are not affected?. Please test the features on the website: DestinationPicker, Signature, Forward Email, Vacation, etc.
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.
We only care about the one overriding dispose
. If originally dispose
"does nothing" (as its author said), why do we have to care if its not modified?
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.
We only care about the one overriding
dispose
. If originallydispose
"does nothing" (as its author said), why do we have to care if its not modified?
The problem here is that we handle many things in the dispose
function. In the current version, if dispose
is not called, the handlers will not be executed. And now if you call it in onClose
maybe some of those actions will throw an error, we don't know. So we need to check that controllers
inherit from BaseController
.
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.
Please ensure that you have tested most of the app's features and that they are working properly with this change.
hi @tddang-linagora any update on it |
Original issue
Why does this PR exist?