Skip to content

[PLATIR-51473] Fix FullScreenMessage onDismiss being called before dismissal#1154

Merged
cdhoffmann merged 1 commit intoadobe:dev-v5.5.2from
cdhoffmann:fixOnDismissPlacement
Jun 24, 2025
Merged

[PLATIR-51473] Fix FullScreenMessage onDismiss being called before dismissal#1154
cdhoffmann merged 1 commit intoadobe:dev-v5.5.2from
cdhoffmann:fixOnDismissPlacement

Conversation

@cdhoffmann
Copy link
Copy Markdown
Contributor

@cdhoffmann cdhoffmann commented Jun 23, 2025

We were calling onDismiss for the FullScreenMessageDelegate and the MessagingDelegate within the dismiss() function before we actually dismissed the message within the dismissWithAnimation. This meant that if someone was listening for the onDismiss call while managing their FullScreenMessage, they could delete the instance of the FullScreenMessage in between the dismiss and dismissWithAnimation call. In addition, the dismissWithAnimation function recently added a [weak self] and guard self = self else { return } which would mean that self could be nil here and the actual dismiss code would never be reached.

Description

Now, the onDismiss delegate calls will happen after the dismissal actually occurs and only when the dismissWithAnimation(shouldDeallocateWebView: Bool) parameter is true because we also call this within hide(), and we do not want to call onDismiss when hiding.

Related Issue

[PLATIR-51473]

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Copy Markdown
Member

@sbenedicadb sbenedicadb left a comment

Choose a reason for hiding this comment

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

looks good. thanks.

@cdhoffmann cdhoffmann merged commit d0b255a into adobe:dev-v5.5.2 Jun 24, 2025
17 checks passed
@cdhoffmann cdhoffmann deleted the fixOnDismissPlacement branch June 24, 2025 14:50
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.

3 participants