-
Notifications
You must be signed in to change notification settings - Fork 594
[UWP Renderer] Allow nested fallbacks #8234
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anna-dingler
commented
Jan 17, 2023
|
Hi @anna-dingler. This pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along. |
Contributor
|
Staleness reset by anna-dingler |
anna-dingler
commented
Feb 23, 2023
beervoley
reviewed
Mar 20, 2023
beervoley
approved these changes
Mar 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
Fixes #8324
Description
Added a try/catch block so that we can make the recursive call to
RenderFallbackif we catchE_PERFORM_FALLBACKCall
RenderFallbackif nofallbackRendereris foundIf the last fallback element within nested fallback does not render,
ancestorHasFallbackwill be true. This caused us to throwE_PERFORM_CALLBACKwhich is caught by the initial element. If this element did not have a fallback, it will be dropped.Ex: Container (does not have fallback) -> ChildElement -> Fallback1 -> Fallback2 -> Fallback3
ChildElement, Fallback1, and Fallback2 all failed. When Fallback3 fails, it will try to get the fallback mechanism of it's ancestor (Fallback2) by throwing
E_PERFORM_FALLBACK. However, this error will land on the Container since all of the other elements failed. Without a fallback mechanism, the Container will be dropped.To fix this issue, I added a try/catch block for when we call
RenderFallbackon a child element. In the catch, we can verify that the parent element actually has a fallback mechanism before throwing the error.Sample Card
https://github.com/microsoft/AdaptiveCards/blob/main/samples/v1.2/Tests/ContainerDoubleFallback.json
https://github.com/microsoft/AdaptiveCards/blob/main/samples/v1.2/Tests/DeepFallback.json
How Verified
Verified manually on the AdaptiveCards Visualizer.
Before
After
Microsoft Reviewers: Open in CodeFlow