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

Remove activity logs after logging out #19930

Merged
merged 5 commits into from
Jan 18, 2023
Merged

Conversation

staskus
Copy link
Contributor

@staskus staskus commented Jan 17, 2023

Fixes #19913

Description

We do not delete activity logs when logging out.

Handling 2 cases:

  • Logging out of WP.com site
  • Removing self-hosted site

Testing instructions

Case 1: WP.com accounts:

  1. Launch the app and log in.
  2. Use the app for a while.
  3. Log out and log in with a different account.
  4. Open Me screen by tapping your profile icon on the top of the screen.
  5. Tap "Help & Support"
  6. Tap "Activity Logs".
  7. Look inside your saved logs and confirm your logs from your logged-out account are not visible

Case 2: Self-hosted site

  1. Launch the app and log in to a self-hosted site with no .com account
  2. Use the app for a while.
  3. "Remove site" and log in with a different account
  4. Open Me screen by tapping your profile icon on the top of the screen.
  5. Tap "Help & Support"
  6. Tap "Activity Logs".
  7. Look inside your saved logs and confirm your logs from your remoted self-hosted site are not visible

Case 3: Multiple sites, removing self-hosted site when more sites are available

  1. Launch the app and log in
  2. Add self-hosted site
  3. Use the app for a while.
  4. Remove self-hosted site, the app switches to another account
  5. Open Me screen by tapping your profile icon on the top of the screen.
  6. Tap "Help & Support"
  7. Tap "Activity Logs".
  8. Look inside your saved logs and confirm that logs are visible

Regression Notes

  1. Potential unintended areas of impact

Disrupting logout or site removal flows

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

Manually testing that account logout and site removal process continue working smoothly. Inspecting activity logs.

  1. What automated tests I added (or what prevented me from doing so)

None

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • 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.

@staskus staskus changed the title Fix/19913 clear activity logs Remove activity logs after logging out Jan 17, 2023
@staskus staskus requested review from sla8c, guarani and irfano January 17, 2023 12:47
@staskus staskus marked this pull request as ready for review January 17, 2023 12:47
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 17, 2023

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19930-b3a1770 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 17, 2023

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19930-b3a1770 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Contributor

@sla8c sla8c left a comment

Choose a reason for hiding this comment

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

@staskus LGTM and nice refactor + encapsulation into functions! 👍

Copy link
Member

@irfano irfano left a comment

Choose a reason for hiding this comment

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

All tests passed. ✅
Do we keep removed site logs in case 3 on purpose? I think we can remove them if it's easy to filter logs related to the removed site.

@staskus
Copy link
Contributor Author

staskus commented Jan 18, 2023

Do we keep removed site logs in case 3 on purpose? I think we can remove them if it's easy to filter logs related to the removed site.

@irfano thanks for testing! Not on purpose. We don't filter these activity logs by blogs, so if we switch between sites, we will have one set of logs. Case 3 was to make sure that all logs are not deleted by accident only when one site is removed but account remains logged in.

@staskus staskus enabled auto-merge (squash) January 18, 2023 12:31
@staskus staskus merged commit 84ab9ad into trunk Jan 18, 2023
@staskus staskus deleted the fix/19913-clear-activity-logs branch January 18, 2023 13:00
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.

Activity logs should be cleared
4 participants