Skip to content

Conversation

@anna-dingler
Copy link
Contributor

@anna-dingler anna-dingler commented Jan 17, 2023

Related Issue

Fixes #8324

Description

  1. Added a try/catch block so that we can make the recursive call to RenderFallback if we catch E_PERFORM_FALLBACK

  2. Call RenderFallback if no fallbackRenderer is found

  3. If the last fallback element within nested fallback does not render, ancestorHasFallback will be true. This caused us to throw E_PERFORM_CALLBACK which 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 RenderFallback on 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

image

image

After

image

image

Microsoft Reviewers: Open in CodeFlow

anna-dingler and others added 5 commits December 16, 2022 00:41
* Update custom.props for object model release

* Updated Xcode version (#8222)

* removed build step as they are redundant (#8201)

* removed build step as they are redundant

* added pod installation step

Co-authored-by: Joseph Woo <Joseph.Woo@microsoft.com>
* Update custom.props for object model release

* Updated Xcode version (#8222)

* removed build step as they are redundant (#8201)

* removed build step as they are redundant

* added pod installation step

* Add a null check for inline Actions

Co-authored-by: Joseph Woo <Joseph.Woo@microsoft.com>
@ghost ghost added the no-recent-activity label Jan 22, 2023
@ghost
Copy link

ghost commented Jan 22, 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.

@anna-dingler anna-dingler changed the base branch from release/uwp-v3.1.0 to main February 22, 2023 17:13
@microsoft-github-policy-service
Copy link
Contributor

Staleness reset by anna-dingler

@anna-dingler anna-dingler merged commit 4037a50 into main Mar 20, 2023
@anna-dingler anna-dingler deleted the anna/updateFallbackBehavior branch March 20, 2023 18:20
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.

[UWP Renderer] Nested fallback is not working correctly

5 participants