Skip to content
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

chore: ensure Android component is initialized from services #451

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

mrehan27
Copy link
Contributor

@mrehan27 mrehan27 commented Oct 7, 2024

Changes

  • Renamed registerAndroidSDKComponent to ensureAndroidComponent for clearer purpose
  • Called the renamed method from all entry points (push services, activities) to ensure Android component is always initialized before accessing any of its dependencies
  • Removed unused, deprecated methods from DiGraph, as they were intended for SDK use only

@mrehan27 mrehan27 self-assigned this Oct 7, 2024
Copy link

github-actions bot commented Oct 7, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • java_layout: rehan/push-killed-state (1728301214)
  • kotlin_compose: rehan/push-killed-state (1728301212)

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 52.18%. Comparing base (c340010) to head (a8d7405).
Report is 1 commits behind head on feature/react-native-cdp.

Files with missing lines Patch % Lines
...essagingpush/CustomerIOFirebaseMessagingService.kt 0.00% 2 Missing ⚠️
.../messagingpush/CustomerIOCloudMessagingReceiver.kt 0.00% 1 Missing ⚠️
...push/activity/NotificationClickReceiverActivity.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##             feature/react-native-cdp     #451      +/-   ##
==============================================================
- Coverage                       52.25%   52.18%   -0.07%     
  Complexity                        291      291              
==============================================================
  Files                              96       96              
  Lines                            2258     2261       +3     
  Branches                          352      352              
==============================================================
  Hits                             1180     1180              
- Misses                            974      977       +3     
  Partials                          104      104              

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


// TODO: Remove deprecated functions after all usages are removed.
@Deprecated("Use overrideDependency<Dependency> instead", ReplaceWith("overrideDependency<Dependency>(value)"))
fun <Dependency : Any> overrideDependency(dependency: Class<Dependency>, value: Dependency) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed these as they were deprecated and are no longer used by any DI graph in the SDK

*/
fun SDKComponent.registerAndroidSDKComponent(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the method is intended for internal SDK use only, I renamed it to provide more clarity on its purpose and function.

@mrehan27 mrehan27 requested a review from Shahroz16 October 7, 2024 09:47
Copy link

github-actions bot commented Oct 7, 2024

Build available to test
Version: rehan-push-killed-state-SNAPSHOT
Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

Copy link

github-actions bot commented Oct 7, 2024

📏 SDK Binary Size Comparison Report

No changes detected in SDK binary size ✅

@mrehan27 mrehan27 merged commit ccfc732 into feature/react-native-cdp Oct 7, 2024
27 of 29 checks passed
@mrehan27 mrehan27 deleted the rehan/push-killed-state branch October 7, 2024 11:41
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.

2 participants