woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

Use `/wp/v2` for uploading files when using a Jetpack site #12938

Closed hichamboushaba closed 3 hours ago

hichamboushaba commented 5 days ago

Closes: #12836

Description

This PR updates FluxC (https://github.com/wordpress-mobile/WordPress-FluxC-Android/pull/3109) to include the change of using /wp/v2 for media operations (upload and fetch) instead of the legacy /v1.1 version. The new endpoints work even when XMLRPC is unavailable, which is a common case now since the Jetpack Connection doesn't require it anymore (pf5801-LY-p2), so it should hopefully improve the experience for many users.

Steps to reproduce

  1. Use a Jetpack connected site.
  2. Install the plugin Disable XML-RPC-API
  3. Open the app.
  4. Open a product.

Testing information

The tests that have been performed

^

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

dangermattic commented 5 days ago
1 Warning
:warning: This PR is assigned to the milestone 21.2. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by :no_entry_sign: Danger

wpmobilebot commented 5 days ago

Project dependencies changes

The following changes in project dependencies were detected (configuration vanillaReleaseRuntimeClasspath):

list ``` Upgraded Dependencies org.wordpress.fluxc.plugins:woocommerce:3109-6cd1ad6b371c033d40b8483b894004c3df874b11, (changed from trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0) org.wordpress.fluxc:fluxc-annotations:3109-6cd1ad6b371c033d40b8483b894004c3df874b11, (changed from trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0) org.wordpress:fluxc:3109-6cd1ad6b371c033d40b8483b894004c3df874b11, (changed from trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0) ```
tree ```diff -+--- org.wordpress:fluxc:trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0 -| +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.25 -> 2.0.21 -| | +--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 (*) -| | \--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:2.0.21 -| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 (*) -| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6 -| | \--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*) -| +--- androidx.security:security-crypto:1.0.0 -> 1.1.0-alpha03 -| | +--- androidx.annotation:annotation:1.1.0 -> 1.8.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.6.1 (*) -| +--- androidx.room:room-ktx:2.6.1 -| | +--- androidx.room:room-common:2.6.1 (*) -| | +--- androidx.room:room-runtime:2.6.1 (*) -| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.21 (*) -| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1 -> 1.8.1 (*) -| | +--- androidx.room:room-common:2.6.1 (c) -| | \--- androidx.room:room-runtime:2.6.1 (c) -| +--- com.google.dagger:dagger:2.51.1 -| | \--- javax.inject:javax.inject:1 -| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1 (*) -| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1 (*) -| +--- org.wordpress:wellsql:2.0.0 -| | +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*) -| | \--- org.wordpress.wellsql:wellsql-annotations:2.0.0 -| +--- org.wordpress.fluxc:fluxc-annotations:trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0 -| +--- org.greenrobot:eventbus:3.3.1 (*) -| +--- org.greenrobot:eventbus-java: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.8.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.7.0 (*) -| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.7.0 (*) -| | \--- 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:1.9.25 -> 2.0.21 (*) ++--- org.wordpress:fluxc:3109-6cd1ad6b371c033d40b8483b894004c3df874b11 +| +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.25 -> 2.0.21 +| | +--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 (*) +| | \--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:2.0.21 +| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 (*) +| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6 +| | \--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*) +| +--- androidx.security:security-crypto:1.0.0 -> 1.1.0-alpha03 +| | +--- androidx.annotation:annotation:1.1.0 -> 1.8.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.6.1 (*) +| +--- androidx.room:room-ktx:2.6.1 +| | +--- androidx.room:room-common:2.6.1 (*) +| | +--- androidx.room:room-runtime:2.6.1 (*) +| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.21 (*) +| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1 -> 1.8.1 (*) +| | +--- androidx.room:room-common:2.6.1 (c) +| | \--- androidx.room:room-runtime:2.6.1 (c) +| +--- com.google.dagger:dagger:2.51.1 +| | \--- javax.inject:javax.inject:1 +| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1 (*) +| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1 (*) +| +--- org.wordpress:wellsql:2.0.0 +| | +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*) +| | \--- org.wordpress.wellsql:wellsql-annotations:2.0.0 +| +--- org.wordpress.fluxc:fluxc-annotations:3109-6cd1ad6b371c033d40b8483b894004c3df874b11 +| +--- org.greenrobot:eventbus:3.3.1 (*) +| +--- org.greenrobot:eventbus-java: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.8.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.7.0 (*) +| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.7.0 (*) +| | \--- 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:1.9.25 -> 2.0.21 (*) -\--- org.wordpress.fluxc.plugins:woocommerce:trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0 - +--- org.wordpress:fluxc:trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0 (*) - +--- com.google.code.gson:gson:2.8.5 -> 2.10.1 - +--- com.google.dagger:dagger:2.51.1 (*) - +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1 (*) - +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1 (*) - +--- androidx.room:room-runtime:2.6.1 (*) - +--- org.wordpress:wellsql:2.0.0 (*) - +--- org.wordpress.fluxc:fluxc-annotations:trunk-cc17141a0e910d5b808ba6bbfb4b7d393d3517a0 - +--- androidx.room:room-ktx:2.6.1 (*) - \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 -> 2.0.21 (*) +\--- org.wordpress.fluxc.plugins:woocommerce:3109-6cd1ad6b371c033d40b8483b894004c3df874b11 + +--- org.wordpress:fluxc:3109-6cd1ad6b371c033d40b8483b894004c3df874b11 (*) + +--- com.google.code.gson:gson:2.8.5 -> 2.10.1 + +--- com.google.dagger:dagger:2.51.1 (*) + +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1 (*) + +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1 (*) + +--- androidx.room:room-runtime:2.6.1 (*) + +--- org.wordpress:wellsql:2.0.0 (*) + +--- org.wordpress.fluxc:fluxc-annotations:3109-6cd1ad6b371c033d40b8483b894004c3df874b11 + +--- androidx.room:room-ktx:2.6.1 (*) + \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 -> 2.0.21 (*) ```
wpmobilebot commented 5 days ago
📲 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 Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit5f284c873c6996d852c4e89850adc32f0f7f3daa
Direct Downloadwoocommerce-wear-prototype-build-pr12938-5f284c8.apk
wpmobilebot commented 5 days ago

📲 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
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit5f284c873c6996d852c4e89850adc32f0f7f3daa
Direct Downloadwoocommerce-prototype-build-pr12938-5f284c8.apk