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

Update deprecated Parcel functions #18068

Merged

Conversation

irfano
Copy link
Member

@irfano irfano commented Mar 8, 2023

This PR is part of a parent PR to update compileSdk to 33.

  • androidx.core was updated to 1.9.0 to be able to use ParcelCompat.readParcelable and ParcelCompat.readList functions.

To test:
Being able to build and basic smoke test should be enough.

Regression Notes

  1. Potential unintended areas of impact
    Notifications might be affected.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    I tested notifications manually on devices with Android 13 and lower version.

  3. What automated tests I added (or what prevented me from doing so)
    N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@irfano irfano mentioned this pull request Mar 8, 2023
8 tasks
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 8, 2023

WordPress📲 You can test these changes on WordPress by downloading wordpress-installable-build-pr18068-b5bc515.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppWordPress
Build FlavorJalapeno
Build TypeDebug
Commitb5bc515
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 8, 2023

Jetpack📲 You can test these changes on Jetpack by downloading jetpack-installable-build-pr18068-b5bc515.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppJetpack
Build FlavorJalapeno
Build TypeDebug
Commitb5bc515
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

👋 @irfano !

I have reviewed and tested this PR as per the instructions, everything works as expected, good job! 🌟 🌟 🌟

FYI: In addition to the basic smoke test, I did some target testing, see below:

  • Media Screen: Because of the MediaItem.kt change.
  • Stats Screen: Because of the SeelctedDateProvider.kt change.
  • Notifications Screen & Functionality: Because of the AndroidManifest.xml change.

I can verify that everything works as expected! 🚀


Added android.permission.POST_NOTIFICATIONS to fix the build error.

Question (❓): How did the build failed, I tried removing this permission and running assembleJetpackWasabiDebug in order to notice this build error but couldn't identify one (nor a warning). 🤔

Can you guide me here please? 🙏

...but notifications still works on Android 13 and lower versions.

This is true, I tested this by creating a new post and then seeing the notification showing right after, that is, even though I clicked the Don't Allow button when the Notification Permission dialog appeared after a clean install of the app.

@ParaskP7
Copy link
Contributor

ParaskP7 commented Mar 9, 2023

FYI: The only thing that doesn't make me feel comfortable with this change is the fact that the 1.9.0 transitively updates Kotlin from 1.6.21 to 1.7.10 (see here). 😞

PS: I was hoping to avoid such a transitive update and do such an update via #17563 . But, I guess we are now reaching a deadlock where #17563 needs #17790 and #17790 can't be completed with the the 1.9.0 update. 🤷

Or maybe, we could skip the 1.9.0 update in this PR, just to be on the safe side and add create our own compat extension functions, just like you did with #18061. 🤔

Wdyt @irfano ?

@irfano
Copy link
Member Author

irfano commented Mar 9, 2023

FYI: In addition to the basic smoke test, I did some target testing, see below:

Thank you for the additional testing, @ParaskP7. ❤️

Question (❓): How did the build failed, I tried removing this permission and running assembleJetpackWasabiDebug in order to notice this build error but couldn't identify one (nor a warning). 🤔

Can you guide me here please? 🙏

It was showing a warning when running ./gradlew lintWordPressVanillaRelease but not blocking the build since allWarningsAsErrors is disabled temporarily in the feature branch.

Or maybe, we could skip the 1.9.0 update in this PR, just to be on the safe side and add create our own compat extension functions, just like you did with #18061. 🤔

I reverted all changes and created new functions in CompatExtensions to be on the safe side.
Can you please handle updating comments on related issues and open a new PR to update androidx.core to 1.9.0?

…-for-android13

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/SelectedDateProvider.kt
#	WordPress/src/main/java/org/wordpress/android/util/extensions/CompatExtensions.kt
@irfano irfano requested a review from ParaskP7 March 9, 2023 15:26
@irfano
Copy link
Member Author

irfano commented Mar 9, 2023

This is true, I tested this by creating a new post and then seeing the notification showing right after, that is, even though I clicked the Don't Allow button when the Notification Permission dialog appeared after a clean install of the app.

You saw the notification on the Notifications tab in the app, right?
The "Don't allow" button on the notification permission dialog prevents notification alerts from being displayed on the device, but they can still appear on the Notifications tab of the app.

@ParaskP7
Copy link
Contributor

ParaskP7 commented Mar 9, 2023

👋 @irfano and thank you for the update! ❤️ 🙇 🚀

It was showing a warning when running ./gradlew lintWordPressVanillaRelease but not blocking the build since allWarningsAsErrors is disabled temporarily in the feature branch.

I see, I see, so it was a warning then not an error, it just this warnings was failing the build due to allWarningsAsErrors, got it! 🙏

Btw, thanks for reverting this change, I agree with that too, as it might be better to add this commit when we re-enabled allWarningsAsErrors on the parent PR. 💯

I reverted all changes and created new functions in CompatExtensions to be on the safe side.

This is great, thanks for doing that, I agree, staying on the safe side might be wise atm! 💯

FYI: I went on another round of reviewing and testing, everything looks LGTM and works as expected! 🌟 🌟 🌟

It is a ✅ from my side, let's merge! 🚀

Can you please handle updating comments on related issues and open a new PR to update androidx.core to 1.9.0?

Done! 🎯

FYI: I added an UPDATE section on this comment of mine.

@ParaskP7
Copy link
Contributor

ParaskP7 commented Mar 9, 2023

You saw the notification on the Notifications tab in the app, right?
The "Don't allow" button on the notification permission dialog prevents notification alerts from being displayed on the device, but they can still appear on the Notifications tab of the app.

I actually saw the notification alerts being displayed even on the device, not only on the Notifications tab, which would have been displayed anyway of course.

That is with me clicking Don't allow, yes... 🤷 I am not sure if I am missing something. 🤔

Can you give me an example of a specific notification that during your testing, when you click Don't allow, on an Android 13 device, that notification is NOT shown, that is, it not being popping-up in your device notifications panel, versus it being shown when you click Allow instead. 🙏

@irfano
Copy link
Member Author

irfano commented Mar 9, 2023

You saw the notification on the Notifications tab in the app, right?
The "Don't allow" button on the notification permission dialog prevents notification alerts from being displayed on the device, but they can still appear on the Notifications tab of the app.

I actually saw the notification alerts being displayed even on the device, not only on the Notifications tab, which would have been displayed anyway of course.

That is with me clicking Don't allow, yes... 🤷 I am not sure if I am missing something. 🤔

Can you give me an example of a specific notification that during your testing, when you click Don't allow, on an Android 13 device, that notification is NOT shown, that is, it not being popping-up in your device notifications panel, versus it being shown when you click Allow instead. 🙏

I have tested the case and here are the instructions:

  1. Perform a clean installation of JP.
  2. Tap on "Don't allow" when the notification permission dialog appears.
  3. Log in to the app.
  4. Send a comment to my site from the web.
  5. No notifications appeared on the device.

After tapping the "Don't allow" button, the notification permission should be off in the app settings.

@ParaskP7
Copy link
Contributor

ParaskP7 commented Mar 9, 2023

👋 @irfano !

I have tested the case and here are the instructions:

Ah, you are right, it was my bad, I am having all 3 variations of the Jetpack app on my testing phone, production (vanilla), beta (wasabi) and alpha (jalapeno). The production Jetpack app was logged-in with my user and was receiving the notification, and I, without noticing that the icon on that notification was the production Jetpack icon (not the beta Jetpack icon), incorrectly assumed that notification was working even when we are clicking Don't allow... 😅 🚏 🚌

I tested it again just now, just to be on the safe side, with both, clicking Don't allow and Allow, sending the notification as per your instructions and I can verify I get the same behaviour to your testing, as expected, obviously! 😅 🛌 😴

Thank you for making me realize this silly testing mistake of mine! 🙇 😅 💤

@irfano
Copy link
Member Author

irfano commented Mar 9, 2023

Ah, you are right, it was my bad, I am having all 3 variations of the Jetpack app on my testing phone, production (vanilla), beta (wasabi) and alpha (jalapeno). The production Jetpack app was logged-in with my user and was receiving the notification, and I, without noticing that the icon on that notification was the production Jetpack icon (not the beta Jetpack icon), incorrectly assumed that notification was working even when we are clicking Don't allow... 😅 🚏 🚌

I tested it again just now, just to be on the safe side, with both, clicking Don't allow and Allow, sending the notification as per your instructions and I can verify I get the same behaviour to your testing, as expected, obviously! 😅 🛌 😴

Thank you for making me realize this silly testing mistake of mine! 🙇 😅 💤

It's good to test all cases. 😄
It looks like we're good to merge now. 🚀

@irfano irfano merged commit 01736fb into feature/update-compile-sdk-33 Mar 9, 2023
@irfano irfano deleted the update-parcelcompat-for-android13 branch March 9, 2023 16:38
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.

3 participants