Skip to content

Fix paywall footer dismissal crash #1120

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 1 commit into from
Oct 30, 2024
Merged

Fix paywall footer dismissal crash #1120

merged 1 commit into from
Oct 30, 2024

Conversation

tonidero
Copy link
Contributor

This fixes #994

Basically when the footer is dismissed within the same view, it triggers a new layout, which since we call a remeasurement with a post call, this remeasurement may happen after the view has been removed from the window. This view requires access to the context to be able to obtain the ViewModel in the underlying composable, causing a crash.

Verified

This commit was signed with the committer’s verified signature.
kemuru Marino
@tonidero tonidero requested a review from a team October 30, 2024 11:15
Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

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

Awesome!

Comment on lines +28 to +30
// It's possible the view has been detached at this point which can cause issues
// since the viewModel is not available anymore. We don't really need to remeasure
// in this case.
Copy link
Member

Choose a reason for hiding this comment

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

😚👌

@tonidero tonidero enabled auto-merge (squash) October 30, 2024 11:18
@tonidero tonidero merged commit 2e18b45 into main Oct 30, 2024
3 of 4 checks passed
@tonidero tonidero deleted the fix-footer-dismiss-crash branch October 30, 2024 11:24
JayShortway pushed a commit that referenced this pull request Nov 1, 2024
**This is an automatic release.**

## RevenueCat SDK
### 📦 Dependency Updates
* Bump rexml from 3.3.6 to 3.3.9 in /examples/purchaseTesterTypescript
(#1115) via dependabot[bot] (@dependabot[bot])
* Bump cocoapods from 1.15.2 to 1.16.1 (#1119) via dependabot[bot]
(@dependabot[bot])
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 13.7.0 (#1118) via
RevenueCat Git Bot (@RCGitBot)
* [iOS
5.7.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.7.0)
* Bump danger from 9.5.0 to 9.5.1 (#1112) via dependabot[bot]
(@dependabot[bot])
* Bump fastlane from 2.224.0 to 2.225.0 (#1111) via dependabot[bot]
(@dependabot[bot])

## RevenueCatUI SDK
### 🐞 Bugfixes
* Fix paywall footer dismissal crash (#1120) via Toni Rico (@tonidero)

---------

Co-authored-by: RevenueCat CI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants