Skip to content

Fix CoroutineCreationDuringComposition lint error on AGP 8.13.0#2659

Merged
tonidero merged 2 commits into
mainfrom
launchedeffect
Sep 9, 2025
Merged

Fix CoroutineCreationDuringComposition lint error on AGP 8.13.0#2659
tonidero merged 2 commits into
mainfrom
launchedeffect

Conversation

@vegaro

@vegaro vegaro commented Sep 9, 2025

Copy link
Copy Markdown
Member

Fixes #2588 (comment)

A new lint issue that starts happening when upgrading to AGP 8.13.0

Also wrapped the refreshStateIfColorsChanged in a LaunchedEffect keyed by the inputs, so it only runs when the theme actually changes.

@vegaro vegaro requested a review from tonidero September 9, 2025 08:03
@vegaro vegaro changed the title Fix CoroutineCreationDuringComposition lint issue Fix CoroutineCreationDuringComposition lint error on AGP 8.13.0 Sep 9, 2025
@codecov

codecov Bot commented Sep 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.09%. Comparing base (9eb73ce) to head (96e87dd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2659   +/-   ##
=======================================
  Coverage   78.09%   78.09%           
=======================================
  Files         306      306           
  Lines       11484    11484           
  Branches     1590     1590           
=======================================
  Hits         8968     8968           
  Misses       1819     1819           
  Partials      697      697           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit: Thanks for doing this!

val colorScheme = MaterialTheme.colorScheme
val isDark = isSystemInDarkTheme()

LaunchedEffect(colorScheme, isDark) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is good! I wonder if we could remove the checks we do on the refreshStateIfColorsChanged method that check that the values haven't changed after this change... but I guess they won't hurt either so FFTI.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

nice! I will make the change now, otherwise I will forget lol

@vegaro vegaro added this pull request to the merge queue Sep 9, 2025
@vegaro vegaro removed this pull request from the merge queue due to a manual request Sep 9, 2025
@vegaro vegaro enabled auto-merge September 9, 2025 08:57
@tonidero tonidero disabled auto-merge September 9, 2025 09:10
@tonidero tonidero enabled auto-merge September 9, 2025 09:11
@tonidero tonidero added this pull request to the merge queue Sep 9, 2025
Merged via the queue into main with commit 3e6f654 Sep 9, 2025
21 checks passed
@tonidero tonidero deleted the launchedeffect branch September 9, 2025 09:35
tonidero pushed a commit that referenced this pull request Sep 10, 2025
Fixes
#2588 (comment)

A new lint issue that starts happening when upgrading to AGP 8.13.0

Also wrapped the `refreshStateIfColorsChanged` in a LaunchedEffect keyed
by the inputs, so it only runs when the theme actually changes.
@tonidero tonidero mentioned this pull request Sep 10, 2025
tonidero pushed a commit that referenced this pull request Sep 10, 2025
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Add `RevenueCatBackupAgent` (#2625) via Toni Rico (@tonidero)

### 🔄 Other Changes
* Fix CoroutineCreationDuringComposition lint error on AGP 8.13.0
(#2659) via Cesar de la Vega (@vegaro)
* Support setting null offering id on PaywallView (#2658) via Toni Rico
(@tonidero)

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants