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

Trigger dispose before onClose in BaseController #2957

Open
wants to merge 1 commit into
base: refactor
Choose a base branch
from

Conversation

tddang-linagora
Copy link
Contributor

Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/2957.

@override
void onClose() {
super.onClose();
dispose();
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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?

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.

Copy link
Member

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.

@hoangdat
Copy link
Member

hi @tddang-linagora any update on it

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