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

Add some defensive code around layout propagation #24217

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Aug 13, 2024

Description of Change

We still haven't been able to reproduce this issue ourselves, but based on users stack traces we have identified certain areas that might cause these exceptions.

All of the changes in this PR are good changes to make. None of these changes are purely a guess that doesn't have some other functional benefit.

My guess is that the fix to NavigationRenderer and WrapperView are probably what's resolving the crash most directly. In .NET MAUI we try to never actually dispose of anything because it can lead to the exceptions that users are seeing.

The fixes around LayoutIfNeeded are somewhat of a guess and do run the risk of just pushing this bug down the road.

That being said, not calling LayoutIfNeeded when we aren't part of the visual tree is a valid change to make and this change will at least make this path not crash.

Issues Fixed

Fixes #24032

@PureWeen PureWeen marked this pull request as ready for review August 14, 2024 20:33
@PureWeen PureWeen requested a review from a team as a code owner August 14, 2024 20:33
@PureWeen PureWeen requested review from Eilon and mattleibow and removed request for a team August 14, 2024 20:33
@PureWeen
Copy link
Member Author

The failure on MAUI isn't really a failure

CI is reporting the wrong result for some reason

@PureWeen PureWeen merged commit d85c05f into release/8.0.1xx-sr8 Aug 15, 2024
16 of 17 checks passed
@PureWeen PureWeen deleted the fix_dispose_parts branch August 15, 2024 16:22
@PureWeen
Copy link
Member Author

/backport to main

Copy link
Contributor

Started backporting to main: https://github.com/dotnet/maui/actions/runs/10410298401

Copy link
Contributor

@PureWeen backporting to main failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Add some defensive code around layout propagation
.git/rebase-apply/patch:95: trailing whitespace.
						
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	eng/Versions.props
Falling back to patching base and 3-way merge...
Auto-merging eng/Versions.props
CONFLICT (content): Merge conflict in eng/Versions.props
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Add some defensive code around layout propagation
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@PureWeen an error occurred while backporting to main, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

PureWeen added a commit that referenced this pull request Aug 26, 2024
PureWeen added a commit that referenced this pull request Aug 26, 2024
PureWeen added a commit that referenced this pull request Aug 26, 2024
This reverts commit d85c05f.

# Conflicts:
#	eng/Versions.props
PureWeen added a commit that referenced this pull request Aug 26, 2024
…24446)

This reverts commit d85c05f.

# Conflicts:
#	eng/Versions.props
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Aug 27, 2024
@samhouts samhouts added fixed-in-8.0.82 and removed fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants