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

Handle content hiding separately for hot restart scenarios #6341

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

captainsafia
Copy link
Member

Description of Change

We've been receiving bug reports that an issue that was resolved by changes to MSBuild in 114d30f still persists in hot reload scenarios or iOS. Both the _CollectBundleResources and _CollectHotRestartBundleResources targets are run during a hot restart build but because of the constraint on target ordering outlined here the hiding/restoring only happens on the first target that is run (_CollectBundleResources).

A target is never run twice during a build, even if a subsequent target in the build depends on it. Once a target has been run, its contribution to the build is complete.

So the current ordering is:

  • Problematic content is hidden
  • _CollectBundleResources runs
  • Problematic content is restored

To resolve this issue, we need to invoke the hiding/restore targets independently for the _CollectBundleResources and _CollectHotRestartBundleResources. The new sequence is as follows:

  • HideContentFromiOSBundleResources hides the content
  • _CollectBundleResources runs
  • RestoreHiddeniOSContent restores the content
  • HideContentFromiOSHotRestartBundleResources hides the content
  • _CollectHotRestartBundleResources runs
  • RestoreHiddeniOSHotRestartContent restores the content

Issues Fixed

Fixes #5245

@captainsafia captainsafia marked this pull request as ready for review April 20, 2022 23:21
@captainsafia captainsafia requested a review from a team as a code owner April 20, 2022 23:21
@jsuarezruiz jsuarezruiz added area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging area-blazor labels Apr 21, 2022
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@javiercn
Copy link
Member

@captainsafia can you ping me on teams to chat about this?

Our thinking was that https://github.com/dotnet/maui/pull/6341/files#diff-a403e09c8175f7c626397dc3695070bc822b977346468fe4cc11504388bbc68bL21 would take care of this.

Do you happen to/can get a binary log for this scenario?

Copy link
Contributor

@TanayParikh TanayParikh left a comment

Choose a reason for hiding this comment

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

LGTM. Kicked off a re-run of the failing CI steps

@captainsafia
Copy link
Member Author

@captainsafia can you ping me on teams to chat about this?

Our thinking was that https://github.com/dotnet/maui/pull/6341/files#diff-a403e09c8175f7c626397dc3695070bc822b977346468fe4cc11504388bbc68bL21 would take care of this.

Synced with Javier offline. We're taking this fix in as a stopgap and will work to address the core issue that required the workaround in the first place in the Xamarian hot reload implementation.

@captainsafia captainsafia merged commit 578d6ed into main Apr 26, 2022
@captainsafia captainsafia deleted the safia/ios-hot-reload-fix branch April 26, 2022 01:35
@robpaveza
Copy link

@captainsafia Looking at the timeline of the merge, I'm supposing that the fix didn't land in time for 17.2 Preview 5? I recently encountered this on a local build. Thanks!

@captainsafia
Copy link
Member Author

Looking at the timeline of the merge, I'm supposing that the fix didn't land in time for 17.2 Preview 5

Correct, this will be part of the next release.

@PBTests
Copy link

PBTests commented Aug 16, 2022

Is there a fix for this? I'm on the absolute latest on both sides and still experience this issue. Can anyone identify a path to a solution? Thanks

@vallgrenerik
Copy link

@captainsafia Is this fix shipped? :)
Because I'm still hitting this issue when I'm trying on my physical device (iPhone) using hot restart.

@captainsafia
Copy link
Member Author

@PBTests @vallgrenerik Would one of you mind opening a new issue for this? In particular, it would be helpful to know what combination of VS and iOS versions you are on.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ios Local device component css failing to load
7 participants