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

Revert DataStore library version #12891

Merged
merged 3 commits into from
Nov 7, 2024
Merged

Conversation

ThomazFB
Copy link
Contributor

@ThomazFB ThomazFB commented Nov 7, 2024

Summary

Fix issue #12867 by reverting the DataStore library version back to 1.0.0.

During the project migration to the Version Catalog, we ended up migrating the DataStore from 1.0.0 to 1.1.0. Unfortunately, this upgrade introduced a current known bug from the library to our app.

To fix it, this PR reverts the app back to the version prior to the Version Catalog migration one month ago.

How to Test

Currently, 90% of the app's reliance on DataStore is related to Analytics and Stats. To properly test this downgrade, I recommend verifying if the Analytics Hub, My Store Stats, and Top Performers are all working as expected.

Update release notes:

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

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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@ThomazFB ThomazFB added type: crash The worst kind of bug. category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. labels Nov 7, 2024
@ThomazFB ThomazFB linked an issue Nov 7, 2024 that may be closed by this pull request
@ThomazFB ThomazFB requested a review from atorresveiga November 7, 2024 18:51
@dangermattic
Copy link
Collaborator

dangermattic commented Nov 7, 2024

1 Warning
⚠️ This PR is assigned to the milestone 21.1. 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 🚫 Danger

@ThomazFB ThomazFB added this to the 21.1 milestone Nov 7, 2024
@wpmobilebot
Copy link
Collaborator

Project dependencies changes

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

list
Removed Dependencies
androidx.datastore:datastore-android:1.1.0
androidx.datastore:datastore-core-android:1.1.0
androidx.datastore:datastore-core-okio:1.1.0
androidx.datastore:datastore-core-okio-jvm:1.1.0
androidx.datastore:datastore-preferences-android:1.1.0
androidx.datastore:datastore-preferences-core-jvm:1.1.0

Upgraded Dependencies
androidx.datastore:datastore:1.0.0, (changed from 1.1.0)
androidx.datastore:datastore-core:1.0.0, (changed from 1.1.0)
androidx.datastore:datastore-preferences:1.0.0, (changed from 1.1.0)
androidx.datastore:datastore-preferences-core:1.0.0, (changed from 1.1.0)
tree
-+--- androidx.datastore:datastore-preferences:1.1.0
-|    \--- androidx.datastore:datastore-preferences-android:1.1.0
-|         +--- androidx.datastore:datastore:1.1.0
-|         |    \--- androidx.datastore:datastore-android:1.1.0
-|         |         +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*)
-|         |         +--- androidx.datastore:datastore-core:1.1.0
-|         |         |    \--- androidx.datastore:datastore-core-android:1.1.0
-|         |         |         +--- androidx.annotation:annotation:1.7.0 -> 1.8.0 (*)
-|         |         |         +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.22 -> 1.9.25
-|         |         |         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 (*)
-|         |         |         |    \--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.25
-|         |         |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 (*)
-|         |         |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.25 (*)
-|         |         |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 -> 1.8.1 (*)
-|         |         |         +--- androidx.datastore:datastore:1.1.0 (c)
-|         |         |         +--- androidx.datastore:datastore-core-okio:1.1.0 (c)
-|         |         |         +--- androidx.datastore:datastore-preferences:1.1.0 (c)
-|         |         |         \--- androidx.datastore:datastore-preferences-core:1.1.0 (c)
-|         |         +--- androidx.datastore:datastore-core-okio:1.1.0
-|         |         |    \--- androidx.datastore:datastore-core-okio-jvm:1.1.0
-|         |         |         +--- androidx.datastore:datastore-core:1.1.0 (*)
-|         |         |         +--- com.squareup.okio:okio:3.4.0 -> 3.7.0
-|         |         |         |    \--- com.squareup.okio:okio-jvm:3.7.0
-|         |         |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.21 -> 1.9.25 (*)
-|         |         |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.25 (*)
-|         |         |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 -> 1.8.1 (*)
-|         |         |         +--- androidx.datastore:datastore:1.1.0 (c)
-|         |         |         +--- androidx.datastore:datastore-core:1.1.0 (c)
-|         |         |         +--- androidx.datastore:datastore-preferences:1.1.0 (c)
-|         |         |         \--- androidx.datastore:datastore-preferences-core:1.1.0 (c)
-|         |         +--- com.squareup.okio:okio:3.4.0 -> 3.7.0 (*)
-|         |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.25 (*)
-|         |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 -> 1.8.1 (*)
-|         |         +--- androidx.datastore:datastore-core:1.1.0 (c)
-|         |         +--- androidx.datastore:datastore-core-okio:1.1.0 (c)
-|         |         +--- androidx.datastore:datastore-preferences:1.1.0 (c)
-|         |         \--- androidx.datastore:datastore-preferences-core:1.1.0 (c)
-|         +--- androidx.datastore:datastore-preferences-core:1.1.0
-|         |    \--- androidx.datastore:datastore-preferences-core-jvm:1.1.0
-|         |         +--- androidx.datastore:datastore-core:1.1.0 (*)
-|         |         +--- androidx.datastore:datastore-core-okio:1.1.0 (*)
-|         |         +--- com.squareup.okio:okio:3.4.0 -> 3.7.0 (*)
-|         |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.25 (*)
-|         |         +--- androidx.datastore:datastore:1.1.0 (c)
-|         |         +--- androidx.datastore:datastore-core:1.1.0 (c)
-|         |         +--- androidx.datastore:datastore-core-okio:1.1.0 (c)
-|         |         \--- androidx.datastore:datastore-preferences:1.1.0 (c)
-|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.25 (*)
-|         +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 -> 1.8.1 (*)
-|         +--- androidx.datastore:datastore:1.1.0 (c)
-|         +--- androidx.datastore:datastore-preferences-core:1.1.0 (c)
-|         +--- androidx.datastore:datastore-core:1.1.0 (c)
-|         \--- androidx.datastore:datastore-core-okio:1.1.0 (c)
++--- androidx.datastore:datastore-preferences:1.0.0
+|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.10 -> 1.9.25 (*)
+|    +--- androidx.datastore:datastore:1.0.0
+|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.10 -> 1.9.25 (*)
+|    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.8.1 (*)
+|    |    +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*)
+|    |    \--- androidx.datastore:datastore-core:1.0.0
+|    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.10 -> 1.9.25 (*)
+|    |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.8.1 (*)
+|    |         \--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
+|    \--- androidx.datastore:datastore-preferences-core:1.0.0
+|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.10 -> 1.9.25 (*)
+|         \--- androidx.datastore:datastore-core:1.0.0 (*)
-+--- androidx.datastore:datastore:1.1.0 (*)
++--- androidx.datastore:datastore:1.0.0 (*)
 +--- com.automattic:Automattic-Tracks-Android:5.0.0
 |    \--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.12.0
-|         \--- com.squareup.okio:okio:3.6.0 -> 3.7.0 (*)
+|         \--- com.squareup.okio:okio:3.6.0 -> 3.7.0
+|              \--- com.squareup.okio:okio-jvm:3.7.0
+|                   \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.21 -> 1.9.25 (*)
 +--- org.wordpress:fluxc:2.99.1
-|    \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.25 (*)
+|    \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.25
+|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 (*)
+|         \--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.25
+|              \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 (*)
 \--- org.wordpress:mediapicker:0.3.1
-     \--- androidx.datastore:datastore-preferences:1.0.0 -> 1.1.0 (*)
+     \--- androidx.datastore:datastore-preferences:1.0.0 (*)

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 7, 2024

📲 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
Commitc68f285
Direct Downloadwoocommerce-wear-prototype-build-pr12891-c68f285.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 7, 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
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitc68f285
Direct Downloadwoocommerce-prototype-build-pr12891-c68f285.apk

@@ -15,7 +15,7 @@
androidx-constraintlayout-main = '2.1.4'
androidx-core-main = '1.13.1'
androidx-core-splashscreen = '1.0.1'
androidx-datastore = '1.1.0'
androidx-datastore = '1.0.0' # Higher versions of the DataStore library are presenting crashes, refer to peaMlT-XN before upgrading it.

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.datastore:datastore than 1.0.0 is available: 1.1.1
@@ -15,7 +15,7 @@
androidx-constraintlayout-main = '2.1.4'
androidx-core-main = '1.13.1'
androidx-core-splashscreen = '1.0.1'
androidx-datastore = '1.1.0'
androidx-datastore = '1.0.0' # Higher versions of the DataStore library are presenting crashes, refer to peaMlT-XN before upgrading it.

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.datastore:datastore than 1.0.0 is available: 1.1.1
@@ -15,7 +15,7 @@
androidx-constraintlayout-main = '2.1.4'
androidx-core-main = '1.13.1'
androidx-core-splashscreen = '1.0.1'
androidx-datastore = '1.1.0'
androidx-datastore = '1.0.0' # Higher versions of the DataStore library are presenting crashes, refer to peaMlT-XN before upgrading it.

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.datastore:datastore than 1.0.0 is available: 1.1.1
@@ -15,7 +15,7 @@
androidx-constraintlayout-main = '2.1.4'
androidx-core-main = '1.13.1'
androidx-core-splashscreen = '1.0.1'
androidx-datastore = '1.1.0'
androidx-datastore = '1.0.0' # Higher versions of the DataStore library are presenting crashes, refer to peaMlT-XN before upgrading it.

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.datastore:datastore-preferences than 1.0.0 is available: 1.1.1
gradle/libs.versions.toml Dismissed Show dismissed Hide dismissed
gradle/libs.versions.toml Dismissed Show dismissed Hide dismissed
Copy link
Contributor

@atorresveiga atorresveiga left a comment

Choose a reason for hiding this comment

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

LGTM!
:shipit:

@atorresveiga atorresveiga merged commit eb38658 into trunk Nov 7, 2024
15 checks passed
@atorresveiga atorresveiga deleted the issue/revert-data-store-version branch November 7, 2024 22:37
@ParaskP7
Copy link
Contributor

ParaskP7 commented Nov 8, 2024

👋 @ThomazFB , thanks for the fix and apologies for the inconvenience! 🙏 🙇

FYI: As part of the Version Catalogs migration I did warn (⚠️) about such changes (see description), and also wrote a descriptive commit on it too, mentioning that WooCommerce and WooCommerce-Wear were using a different version of datastore, point to 1.0.0 and 1.1.0 correspondingly. I hope that with Version Catalogs we will avoid such inconsistencies going forward, along with all the potential problems this could create. 😞

@ThomazFB
Copy link
Contributor Author

ThomazFB commented Nov 8, 2024

Hey @ParaskP7, don't worry about that, and there is no need for apologies; this is not on you in any way; we can't predict that a small version bump of a library could introduce a shady crash like that one; this is a quality fault from the library itself. The Version Catalog was an amazing introduction to our app and thanks for all your work on that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. type: crash The worst kind of bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CorruptionException: Unable to parse preferences proto.
5 participants