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

[Bug fix] Fixed a bug where MarkdownTextBlock loses all events after … #3180

Merged
merged 4 commits into from
Mar 31, 2020

Conversation

0x7c13
Copy link
Contributor

@0x7c13 0x7c13 commented Mar 23, 2020

Fixes

Fixed a bug where MarkdownTextBlock loses all events after page re-load. Issue is described here: 0x7c13/Notepads#377

The root cause here is that we should not clear all existing events onUnloaded since page might be reloaded in the future since Unloaded != Dispose. Instead of unhook events and clear references, we should just unhook the events during page unload and re-hook everything back if it reloads. Since we have all the events already unhooked in Unload event, we should expect GC to kicks in at certain point if MarkdownTextBlock never reload again in the future. So we are fine of keeping the event references here.

PR Type

Bugfix

What is the current behavior?

MarkdownTextBlock loses all events after re-load.

What is the new behavior?

MarkdownTextBlock should keep all existing events after page re-load.

PR Checklist

Please check if your PR fulfills the following requirements:

  • [ x ] Contains NO breaking changes

…re-load

[Bug fix] Fixed a bug where MarkdownTextBlock loses all events after re-load. Issue is described here: 0x7c13/Notepads#377
@ghost
Copy link

ghost commented Mar 23, 2020

Thanks JasonStein for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@0x7c13
Copy link
Contributor Author

0x7c13 commented Mar 23, 2020

@michael-hawker I accidentally closed it, can you help re-open this PR again? Thanks!

Copy link
Contributor

@azchohfi azchohfi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

Unhook event before assigning to make sure no duplicate
@ghost
Copy link

ghost commented Mar 24, 2020

This PR has been marked as "needs attention 👋" and awaiting a response from the team.

@0x7c13
Copy link
Contributor Author

0x7c13 commented Mar 30, 2020

Should be ready to go, any comments guys?

Copy link
Member

@michael-hawker michael-hawker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this @Jasonstein this was a great fix!

@michael-hawker michael-hawker dismissed azchohfi’s stale review March 31, 2020 21:39

Alex's concern was addressed.

@michael-hawker michael-hawker merged commit 5e01ab6 into CommunityToolkit:master Mar 31, 2020
@michael-hawker michael-hawker added this to the 6.1 milestone Mar 31, 2020
@michael-hawker michael-hawker added bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ and removed needs attention 👋 labels Mar 31, 2020
@michael-hawker michael-hawker mentioned this pull request Apr 1, 2020
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants