Skip to content

Conversation

@wzieba
Copy link
Contributor

@wzieba wzieba commented Nov 14, 2025

Description

This PR introduces pos module. The goal of introducing one is to improve developer experience of the POS by shortening feedback loops.

Code that is required to be used by both WooCommerce and pos should be placed in common module. You can read more about it internally: p91TBi-dCL-p2

Test Steps

Smoke test the app, review code - especially the part with WooFileLogger injection I commented below.

Images/gif

image
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 14, 2025

Project manifest changes for WooCommerce-Wear

The following changes in the WooCommerce-Wear's merged AndroidManifest.xml file were detected (build variant: vanillaRelease):

--- ./build/reports/diff_manifest/WooCommerce-Wear/vanillaRelease/base_manifest.txt	2025-11-17 16:26:16.928754284 +0000
+++ ./build/reports/diff_manifest/WooCommerce-Wear/vanillaRelease/head_manifest.txt	2025-11-17 16:26:29.528782826 +0000
@@ -298,12 +298,12 @@
         </receiver>
 
         <activity
+            android:name="androidx.compose.ui.tooling.PreviewActivity"
+            android:exported="true" />
+        <activity
             android:name="com.google.android.gms.common.api.GoogleApiActivity"
             android:exported="false"
-            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
-        <activity
-            android:name="androidx.compose.ui.tooling.PreviewActivity"
-            android:exported="true" /> <!-- 'android:authorities' must be unique in the device, across all apps -->
+            android:theme="@android:style/Theme.Translucent.NoTitleBar" /> <!-- 'android:authorities' must be unique in the device, across all apps -->
         <provider
             android:name="io.sentry.android.core.SentryInitProvider"
             android:authorities="com.woocommerce.android.SentryInitProvider"

Go to https://buildkite.com/automattic/woocommerce-android/builds/33833/canvas?sid=019a929f-1a19-4ab3-9137-ee483caa7274, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Collaborator

Project dependencies changes

list
+ New Dependencies
org.glassfish:javax.annotation:10.0-b28
tree
-+--- project :libs:commons
-|    +--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 (*)
-|    \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:2.2.21 (*)
++--- project :libs:pos
+|    +--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 (*)
+|    +--- project :libs:commons
+|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 (*)
+|    |    +--- androidx.annotation:annotation:1.9.1 (*)
+|    |    +--- org.glassfish:javax.annotation:10.0-b28
+|    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
+|    |    +--- com.automattic.tracks:crashlogging:6.0.6 (*)
+|    |    +--- androidx.lifecycle:lifecycle-process:2.9.4 (*)
+|    |    +--- com.google.dagger:hilt-android:2.57.2
+|    |    |    +--- com.google.dagger:dagger:2.57.2 (*)
+|    |    |    +--- com.google.dagger:dagger-lint-aar:2.57.2
+|    |    |    +--- com.google.dagger:hilt-core:2.57.2
+|    |    |    |    +--- com.google.dagger:dagger:2.57.2 (*)
+|    |    |    |    +--- com.google.code.findbugs:jsr305:3.0.2
+|    |    |    |    +--- jakarta.inject:jakarta.inject-api:2.0.1
+|    |    |    |    \--- javax.inject:javax.inject:1
+|    |    |    +--- com.google.code.findbugs:jsr305:3.0.2
+|    |    |    +--- androidx.activity:activity:1.5.1 -> 1.9.1 (*)
+|    |    |    +--- androidx.annotation:annotation:1.7.1 -> 1.9.1 (*)
+|    |    |    +--- androidx.annotation:annotation-experimental:1.3.1 -> 1.5.0 (*)
+|    |    |    +--- androidx.fragment:fragment:1.5.1 -> 1.8.9 (*)
+|    |    |    +--- androidx.lifecycle:lifecycle-common:2.5.1 -> 2.9.4 (*)
+|    |    |    +--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 -> 2.9.4 (*)
+|    |    |    +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 -> 2.9.4 (*)
+|    |    |    +--- androidx.savedstate:savedstate:1.2.0 -> 1.3.3 (*)
+|    |    |    +--- javax.inject:javax.inject:1
+|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.21 (*)
+|    |    +--- org.wordpress:utils:3.15.0 (*)
+|    |    \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:2.2.21 (*)
+|    \--- com.google.dagger:hilt-android:2.57.2 (*)
-\--- com.google.dagger:hilt-android:2.57.2
-     +--- com.google.dagger:dagger:2.57.2 (*)
-     +--- com.google.dagger:dagger-lint-aar:2.57.2
-     +--- com.google.dagger:hilt-core:2.57.2
-     |    +--- com.google.dagger:dagger:2.57.2 (*)
-     |    +--- com.google.code.findbugs:jsr305:3.0.2
-     |    +--- jakarta.inject:jakarta.inject-api:2.0.1
-     |    \--- javax.inject:javax.inject:1
-     +--- com.google.code.findbugs:jsr305:3.0.2
-     +--- androidx.activity:activity:1.5.1 -> 1.9.1 (*)
-     +--- androidx.annotation:annotation:1.7.1 -> 1.9.1 (*)
-     +--- androidx.annotation:annotation-experimental:1.3.1 -> 1.5.0 (*)
-     +--- androidx.fragment:fragment:1.5.1 -> 1.8.9 (*)
-     +--- androidx.lifecycle:lifecycle-common:2.5.1 -> 2.9.4 (*)
-     +--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 -> 2.9.4 (*)
-     +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 -> 2.9.4 (*)
-     +--- androidx.savedstate:savedstate:1.2.0 -> 1.3.3 (*)
-     +--- javax.inject:javax.inject:1
-     \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.21 (*)
++--- project :libs:commons (*)
+\--- com.google.dagger:hilt-android:2.57.2 (*)

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 14, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit2fc03f2
Direct Downloadwoocommerce-wear-prototype-build-pr14972-2fc03f2.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 14, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit2fc03f2
Direct Downloadwoocommerce-prototype-build-pr14972-2fc03f2.apk

@wzieba wzieba added the category: performance Related to performance such as slow loading. label Nov 14, 2025
@wzieba wzieba added this to the 23.8 milestone Nov 14, 2025
wzieba and others added 2 commits November 14, 2025 17:53
This fixes the ClassCastException when running WooCommerce tests after
moving WooLog to the commons module.

Changes:
1. Remove Hilt/KSP plugins from commons module - commons doesn't need
   to process Hilt annotations itself. The WooCommerce and Wear modules
   that depend on commons will process any Hilt annotations found in
   commons (like @Inject on WooFileLogger).

2. Replace EntryPoints.get() pattern with direct injection - Changed
   WooLog.init() to accept WooFileLogger directly instead of using
   Context and EntryPoints.get(). This is cleaner and removes the code
   smell of using EntryPoints for something that can be injected.

3. Update WooCommerce's AppConfigModule to inject WooFileLogger into
   provideWooLog() and pass it to WooLog.init().

This approach avoids forcing the Wear module to provide dependencies
(AppCoroutineScope, CoroutineDispatchers) that it doesn't actually use,
since Wear doesn't use WooLog at all.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@wzieba wzieba force-pushed the introduce_pos_module branch from db5a86b to c87d136 Compare November 17, 2025 15:20
private lateinit var fileLogger: WooFileLogger

fun init(context: Context) {
fun init(fileLogger: WooFileLogger) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extra caution: I'm not sure why EntryPoints.get(context, FileLoggerEntryPoint::class.java).fileLogger() was introduced instead of directly passing WooFileLogger. It was added in 41e9dc0 but I couldn't find the reason there on in PR. So I assume, this was just a cosmetic choice to use context + EntryPoints.

So here I refactored it to make it simpler. This also moves injection logic from the commons module, leaving only annotations here.

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 38.47%. Comparing base (d1720fc) to head (2fc03f2).

Files with missing lines Patch % Lines
...c/main/java/com/woocommerce/android/util/WooLog.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14972      +/-   ##
============================================
- Coverage     38.48%   38.47%   -0.01%     
+ Complexity    10240    10239       -1     
============================================
  Files          2155     2156       +1     
  Lines        122167   122258      +91     
  Branches      16807    16812       +5     
============================================
+ Hits          47013    47042      +29     
- Misses        70388    70449      +61     
- Partials       4766     4767       +1     

☔ 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.

@wzieba wzieba marked this pull request as ready for review November 18, 2025 08:03
@wzieba wzieba requested a review from a team as a code owner November 18, 2025 08:03
@wzieba wzieba requested review from samiuelson and removed request for a team November 18, 2025 08:03
@samiuelson samiuelson self-assigned this Nov 19, 2025
Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@samiuelson samiuelson merged commit 0680aa0 into trunk Nov 19, 2025
19 checks passed
@samiuelson samiuelson deleted the introduce_pos_module branch November 19, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: performance Related to performance such as slow loading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants