-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enable account closure #18412
Enable account closure #18412
Conversation
…t-closure--18380-add-close-account-button Add close account button
This still needs some styling work.
This is to reduce some of the repetition.
This provides a button to contact support when account closure is not immediately possible due to active purchases on the account.
…ount-closure--18381-add-confirmation-dialog
This resumes the normal dialog after a three second delay for the purpose of testing the ui, and will be wired up to the real implementation after the FluxC changes are available.
…t-closure--18381-add-confirmation-dialog Add a confirmation dialog for account closure
…t-closure--18381-add-confirmation-dialog Add a confirmation dialog for account closure (addendum)
This will be useful to avoid visual jank from switching dialogs when an error is encountered on the backend. Also, it removes some duplication, and separates concerns.
…t-closure--18393-add-api-endpoint Add support for the close account API endpoint in FluxC
Found 1 violations: The PR caused the following dependency changes:-+--- org.wordpress:fluxc:{strictly trunk-eea5d065c93d9ca6680c28189750e92a6f05f8ac} -> trunk-eea5d065c93d9ca6680c28189750e92a6f05f8ac
-| +--- org.wordpress:wellsql:1.7.0
-| | \--- org.wordpress.wellsql:wellsql-annotations:1.7.0
-| +--- org.wordpress.fluxc:fluxc-annotations:trunk-eea5d065c93d9ca6680c28189750e92a6f05f8ac
-| +--- org.greenrobot:eventbus:3.3.1
-| | \--- org.greenrobot:eventbus-java:3.3.1
-| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.9.2 (*)
-| +--- com.android.volley:volley:1.1.1 -> 1.2.1
-| +--- androidx.paging:paging-runtime:2.1.2
-| | +--- androidx.paging:paging-common:2.1.2
-| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
-| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
-| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.1.0 (*)
-| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.5.1 (*)
-| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.5.1 (*)
-| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
-| +--- com.goterl:lazysodium-android:5.0.2
-| +--- net.java.dev.jna:jna:5.5.0
-| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 -> 1.6.21 (*)
-| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.10 (*)
-| +--- androidx.appcompat:appcompat:1.0.2 -> 1.4.2 (*)
-| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
-| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.3 (*)
-| +--- androidx.security:security-crypto:1.0.0
-| | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0
-| | \--- com.google.crypto.tink:tink-android:1.5.0
-| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2
-| | +--- com.squareup.okhttp3:okhttp:4.9.2 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.6.21 (*)
-| +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
-| +--- org.apache.commons:commons-text:1.10.0
-| | \--- org.apache.commons:commons-lang3:3.12.0
-| +--- androidx.room:room-runtime:2.4.2
-| | +--- androidx.room:room-common:2.4.2
-| | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
-| | +--- androidx.sqlite:sqlite-framework:2.2.0
-| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
-| | | \--- androidx.sqlite:sqlite:2.2.0
-| | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0
-| | +--- androidx.sqlite:sqlite:2.2.0 (*)
-| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.1.0 (*)
-| | \--- androidx.annotation:annotation-experimental:1.1.0
-| +--- androidx.room:room-ktx:2.4.2
-| | +--- androidx.room:room-common:2.4.2 (*)
-| | +--- androidx.room:room-runtime:2.4.2 (*)
-| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 -> 1.6.21 (*)
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.4 (*)
-| +--- com.google.dagger:dagger:2.42
-| | \--- javax.inject:javax.inject:1
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.6.4 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.6.4 (*)
++--- org.wordpress:fluxc:{strictly trunk-3fe318a6de3463bf2444b0d798067546e9a18db0} -> trunk-3fe318a6de3463bf2444b0d798067546e9a18db0
+| +--- org.wordpress:wellsql:1.7.0
+| | \--- org.wordpress.wellsql:wellsql-annotations:1.7.0
+| +--- org.wordpress.fluxc:fluxc-annotations:trunk-3fe318a6de3463bf2444b0d798067546e9a18db0
+| +--- org.greenrobot:eventbus:3.3.1
+| | \--- org.greenrobot:eventbus-java:3.3.1
+| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.9.2 (*)
+| +--- com.android.volley:volley:1.1.1 -> 1.2.1
+| +--- androidx.paging:paging-runtime:2.1.2
+| | +--- androidx.paging:paging-common:2.1.2
+| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
+| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
+| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.1.0 (*)
+| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.5.1 (*)
+| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.5.1 (*)
+| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
+| +--- com.goterl:lazysodium-android:5.0.2
+| +--- net.java.dev.jna:jna:5.5.0
+| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 -> 1.6.21 (*)
+| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.10 (*)
+| +--- androidx.appcompat:appcompat:1.0.2 -> 1.4.2 (*)
+| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
+| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.3 (*)
+| +--- androidx.security:security-crypto:1.0.0
+| | +--- androidx.annotation:annotation:1.1.0 -> 1.3.0
+| | \--- com.google.crypto.tink:tink-android:1.5.0
+| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2
+| | +--- com.squareup.okhttp3:okhttp:4.9.2 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.6.21 (*)
+| +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
+| +--- org.apache.commons:commons-text:1.10.0
+| | \--- org.apache.commons:commons-lang3:3.12.0
+| +--- androidx.room:room-runtime:2.4.2
+| | +--- androidx.room:room-common:2.4.2
+| | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
+| | +--- androidx.sqlite:sqlite-framework:2.2.0
+| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
+| | | \--- androidx.sqlite:sqlite:2.2.0
+| | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0
+| | +--- androidx.sqlite:sqlite:2.2.0 (*)
+| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.1.0 (*)
+| | \--- androidx.annotation:annotation-experimental:1.1.0
+| +--- androidx.room:room-ktx:2.4.2
+| | +--- androidx.room:room-common:2.4.2 (*)
+| | +--- androidx.room:room-runtime:2.4.2 (*)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 -> 1.6.21 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.4 (*)
+| +--- com.google.dagger:dagger:2.42
+| | \--- javax.inject:javax.inject:1
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.6.4 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.6.4 (*)
\--- org.wordpress:login:1.3.0
- \--- org.wordpress:fluxc:2.21.0 -> trunk-eea5d065c93d9ca6680c28189750e92a6f05f8ac (*)
+ \--- org.wordpress:fluxc:2.21.0 -> trunk-3fe318a6de3463bf2444b0d798067546e9a18db0 (*)
Please review and act accordingly
|
…t-closure--18413-add-tracks-events Add account closure tracks events
…t-closure-18409-ut-fix Fix compilation issues in account settings vm tests
This is useful for mocking the implementation in unit tests
…t-closure--18406-add-error-handling-to-flow Add error handling to the account closure flow
…t-closure--add-unit-tests Add unit tests for the account closure feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @mkevins 🥇
The code changes LGTM to me and the added tests look great. I've tested the implementation and went through the UI Changes testing checklist and everything worked great for me 🎉
Deleting progress | Account deleted | Error flow |
---|---|---|
I have two minor UI suggestions that I do not consider blocking:
- Lock the edit box when the deletion is in progress.
- Would it be possible to remove the empty space below the button when the process is complete? If not, would adding some text below the title make it better (e.g.
You would now be logged out and redirected to the app landing screen.
).
I would also suggest adding a release note since it's a new user facing feature.
I think the failing instrumented tests will be fixed with this PR #18464 (related internal ref: p1684409358185439/1684256862.513919-slack-C04TBSWP09M) |
Thanks for reviewing and testing, and for your feedback Antonis!
Great idea! Addressed w/
This is something I noticed as well, and I opened a task for it (#18468). It is a strange issue where the dialog does not change height unless Update: I've opened a PR for this: #18470
Thanks, I agree, I'll add one to this PR. 👍 |
Thank you for reviewing and testing this. I know the testing was cumbersome 😅 . |
FYI I didn't review this again because I reviewed it via all PRs that were merged into it. Not sure if #18464 would've fixed the UI tests, the failures were different: |
Good catch @ovitrif 👍 |
Thank you @antonis for engaging my input 🙇🏻 My feelings tell me the test failures are not caused by the changes we added here 🤞🏻 Though even the slightest possibility should keep us alert, keeping an eye on the tests status IMHO 👀 |
Sounds good @ovitrif 👍 Checking the test crash I think it is related to this Sentry report p1683819728601849-slack-CK3STS3PB |
Thank you both for all your work reviewing and testing this feature. Also, extra thanks for looking into the UI tests. |
Description
This PR adds support for the user to close their account from the account settings screen.
Note: This is a feature branch, and should not be merged until all the respective upstream PRs have been reviewed, tested, and merged onto this branch.
PRs:
(PT: pcdRpT-2yo-p2)
To test:
Note: As this is a feature PR, please test with the latest changes in the HEAD PR's branch: #18444
A note about coverage
When considering the possible errors from the API, some scenarios may be difficult to test or are not relevant to real users / scenarios. E.g.:
UNAUTHORIZED
: This may happen for A8C accounts, but will likely be preempted by the Atomic site error anywayATOMIC_SITE
: This scenario is covered in the testing stepsCHARGEBACKED_SITE
: This may require either mocking the response, or some elaborate manual setupACTIVE_SUBSCRIPTIONS
: This scenario is covered in the testing stepsACTIVE_MEMBERSHIPS
: This is not tested, mainly because I didn't see an easy way to get a disposable account into this stateINVALID_TOKEN
: This state should not be reachable, afaiu (outside of debugging the flow)UNKNOWN
: I don't know how to get this error (no pun intended)I think the manual testing coverage is reasonable, given that, but please let me know if you feel otherwise.
Prerequisites (helpers)
In order to test the following flows, for convenience I have prepared some pre-configured accounts to test certain error conditions. Please see ref: pc8HXX-17y-p2 to access those credentials.
I have also prepared some scripts to make generating disposable accounts easier via
adb
🔴 User with an Atomic site
🔵 Tracked: close_account_failed, Properties: {"error_code":"atomic-site"}
🔵 Tracked: support_opened, Properties: {"origin":"ACCOUNT_CLOSURE_DIALOG"}
🔴 User with a Personal site
🔵 Tracked: close_account_failed, Properties: {"error_code":"active-subscriptions"}
🔵 Tracked: support_opened, Properties: {"origin":"ACCOUNT_CLOSURE_DIALOG"}
🟢 Success case (disposable account)
🔵 Tracked: closed_account
Regression Notes
Potential unintended areas of impact
Account settings
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing
What automated tests I added (or what prevented me from doing so)
We do not currently have the established mocks for testing the account deletion flow, and adding that configuration would exceed the scope of this task.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: