Skip to content

[Watch App] Introduce Orders fetching strategy #11471

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

Conversation

ThomazFB
Copy link
Contributor

@ThomazFB ThomazFB commented May 9, 2024

Sumary

Fix issue #11341 by introducing the actual data fetching system for the Orders list. The fetching works in a dual strategy:

  • If there's network available, fetch the data directly from the Store
  • If there's no network available, request the data from the phone, when available

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@ThomazFB ThomazFB added type: task An internally driven task. feature: android wear labels May 9, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented May 9, 2024

4 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class FetchOrders is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class OrdersRepository is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class DateUtils is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 9, 2024

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

App Name WooCommerce Android
FlavorJalapeno
Build TypeDebug
Commitd8704d2
Direct Downloadwoocommerce-prototype-build-pr11471-d8704d2.apk

@ThomazFB ThomazFB linked an issue May 9, 2024 that may be closed by this pull request
@wpmobilebot
Copy link
Collaborator

Found 1 violations:

The PR caused the following dependency changes:

expand

-+--- org.wordpress:fluxc:3004-3b70bfe78a3e33ee559d6094be7331d76a42a3c1
-|    +--- org.wordpress:wellsql:2.0.0
-|    |    +--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
-|    |    \--- org.wordpress.wellsql:wellsql-annotations:2.0.0
-|    +--- org.wordpress.fluxc:fluxc-annotations:3004-3b70bfe78a3e33ee559d6094be7331d76a42a3c1
-|    +--- org.greenrobot:eventbus:3.3.1 (*)
-|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.12.0 (*)
-|    +--- com.android.volley:volley:1.1.1 -> 1.2.0
-|    +--- androidx.paging:paging-runtime:2.1.2
-|    |    +--- androidx.paging:paging-common:2.1.2
-|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.7.0 (*)
-|    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*)
-|    |    +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*)
-|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*)
-|    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*)
-|    |    \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
-|    +--- com.goterl:lazysodium-android:5.0.2
-|    +--- net.java.dev.jna:jna:5.5.0
-|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*)
-|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.22
-|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
-|    +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*)
-|    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
-|    +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6
-|    |    \--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
-|    +--- androidx.security:security-crypto:1.0.0 -> 1.1.0-alpha03
-|    |    +--- androidx.annotation:annotation:1.1.0 -> 1.7.0 (*)
-|    |    +--- com.google.crypto.tink:tink-android:1.5.0
-|    |    \--- androidx.collection:collection:1.1.0 -> 1.4.0 (*)
-|    +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0
-|    |    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.12.0 (*)
-|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.9.10 (*)
-|    +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
-|    +--- org.apache.commons:commons-text:1.10.0 (*)
-|    +--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)
-|    +--- androidx.room:room-ktx:2.4.2 -> 2.5.2
-|    |    +--- androidx.room:room-common:2.5.2 (*)
-|    |    +--- androidx.room:room-runtime:2.5.2 (*)
-|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*)
-|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*)
-|    +--- com.google.dagger:dagger:2.42 -> 2.50
-|    |    \--- javax.inject:javax.inject:1
-|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
-|    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
++--- org.wordpress:fluxc:3004-1cfad7e12802b8e236297ab4ff3b11997e61d1d7
+|    +--- org.wordpress:wellsql:2.0.0
+|    |    +--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
+|    |    \--- org.wordpress.wellsql:wellsql-annotations:2.0.0
+|    +--- org.wordpress.fluxc:fluxc-annotations:3004-1cfad7e12802b8e236297ab4ff3b11997e61d1d7
+|    +--- org.greenrobot:eventbus:3.3.1 (*)
+|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.12.0 (*)
+|    +--- com.android.volley:volley:1.1.1 -> 1.2.0
+|    +--- androidx.paging:paging-runtime:2.1.2
+|    |    +--- androidx.paging:paging-common:2.1.2
+|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.7.0 (*)
+|    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*)
+|    |    +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*)
+|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*)
+|    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*)
+|    |    \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
+|    +--- com.goterl:lazysodium-android:5.0.2
+|    +--- net.java.dev.jna:jna:5.5.0
+|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*)
+|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.22
+|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
+|    +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*)
+|    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
+|    +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6
+|    |    \--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
+|    +--- androidx.security:security-crypto:1.0.0 -> 1.1.0-alpha03
+|    |    +--- androidx.annotation:annotation:1.1.0 -> 1.7.0 (*)
+|    |    +--- com.google.crypto.tink:tink-android:1.5.0
+|    |    \--- androidx.collection:collection:1.1.0 -> 1.4.0 (*)
+|    +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0
+|    |    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.12.0 (*)
+|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.9.10 (*)
+|    +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
+|    +--- org.apache.commons:commons-text:1.10.0 (*)
+|    +--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)
+|    +--- androidx.room:room-ktx:2.4.2 -> 2.5.2
+|    |    +--- androidx.room:room-common:2.5.2 (*)
+|    |    +--- androidx.room:room-runtime:2.5.2 (*)
+|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*)
+|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*)
+|    +--- com.google.dagger:dagger:2.42 -> 2.50
+|    |    \--- javax.inject:javax.inject:1
+|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
+|    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
-\--- org.wordpress.fluxc.plugins:woocommerce:3004-3b70bfe78a3e33ee559d6094be7331d76a42a3c1
-     +--- org.wordpress:wellsql:2.0.0 (*)
-     +--- org.wordpress.fluxc:fluxc-annotations:3004-3b70bfe78a3e33ee559d6094be7331d76a42a3c1
-     +--- androidx.room:room-ktx:2.4.2 -> 2.5.2 (*)
-     +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*)
-     +--- org.wordpress:fluxc:3004-3b70bfe78a3e33ee559d6094be7331d76a42a3c1 (*)
-     +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
-     +--- com.google.dagger:dagger:2.42 -> 2.50 (*)
-     +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
-     +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
-     \--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)
+\--- org.wordpress.fluxc.plugins:woocommerce:3004-1cfad7e12802b8e236297ab4ff3b11997e61d1d7
+     +--- org.wordpress:wellsql:2.0.0 (*)
+     +--- org.wordpress.fluxc:fluxc-annotations:3004-1cfad7e12802b8e236297ab4ff3b11997e61d1d7
+     +--- androidx.room:room-ktx:2.4.2 -> 2.5.2 (*)
+     +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*)
+     +--- org.wordpress:fluxc:3004-1cfad7e12802b8e236297ab4ff3b11997e61d1d7 (*)
+     +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
+     +--- com.google.dagger:dagger:2.42 -> 2.50 (*)
+     +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
+     +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
+     \--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)

Please review and act accordingly

@ThomazFB ThomazFB changed the title Issue/add orders list store fetching [Watch App] Introduce Orders fetching strategy May 10, 2024
@ThomazFB ThomazFB marked this pull request as ready for review May 10, 2024 22:01
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 62.71186% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 40.62%. Comparing base (16e7b96) to head (d8704d2).

Files Patch % Lines
...merce/android/wear/WearableConnectionRepository.kt 0.00% 12 Missing ⚠️
...rc/main/java/com/woocommerce/commons/wear/Paths.kt 0.00% 7 Missing ⚠️
...ain/java/com/woocommerce/android/util/DateUtils.kt 94.87% 2 Missing ⚠️
...commerce/android/wear/WearableConnectionService.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##             feature/introduce-wear-app   #11471      +/-   ##
================================================================
- Coverage                         40.63%   40.62%   -0.02%     
  Complexity                         5224     5224              
================================================================
  Files                              1082     1082              
  Lines                             63229    63245      +16     
  Branches                           8642     8645       +3     
================================================================
  Hits                              25696    25696              
- Misses                            35220    35236      +16     
  Partials                           2313     2313              

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

@ThomazFB ThomazFB merged commit 19c9b3f into feature/introduce-wear-app May 10, 2024
17 checks passed
@ThomazFB ThomazFB deleted the issue/add-orders-list-store-fetching branch May 10, 2024 22:24
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.

Introduce Order list fetching logic
4 participants