WordPress-Android icon indicating copy to clipboard operation
WordPress-Android copied to clipboard

[Tags Feed] Fix duplicate tracking in Reader subfilter

Open thomashorta opened this issue 9 months ago • 5 comments

Fixes #20814

  • Create mechanism to avoid multiple observers attached to the same observables
    • Making sure it works with Fragment system-initiated re-creation (e.g.: screen rotation)
    • Making sure it works with ViewModel cleared due to Owner destruction and creation with existing previous key
  • Fix sending the reader_filter_sheet_item_selected when selecting a filterable feed (e.g.: Subscriptions and Your Tags)

To Test:

  1. Install Jetpack
  2. Make sure App Setting -> Privacy -> Collect Information is enabled
  3. Make sure reader_tags_feed Feature config is enabled (Debug Settings -> Remote Features
  4. Go to Reader
  5. Go to Subscriptions
  6. Verify reader_filter_sheet_item_selected is not tracked
  7. Tap the subfilter pill
  8. Verify appropriate events are tracked ONLY ONCE
  9. Tap a Site
  10. Verify reader_filter_sheet_item_selected is tracked ONLY ONCE
  11. Tap the pill again
  12. Repeat 9-11 multiple times making sure events are tracked ONLY ONCE per trigger
  13. Go to Your Tags
  14. Repeat 6-12

Regression Notes

  1. Potential unintended areas of impact

    • N/A
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

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

    • Unit tests not added for the one-time initialization mechanism since it is done completely in Fragment and ViewModel non-exposed APIs (onCleared)
    • Unit tests updated for bug fix related to sending reader_filter_sheet_item_selected when opening a filterable feed

PR Submission Checklist:

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

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • [ ] WordPress.com sites and self-hosted Jetpack sites.
  • [x] Portrait and landscape orientations.
  • [ ] Light and dark modes.
  • [ ] Fonts: Larger, smaller and bold text.
  • [ ] High contrast.
  • [ ] Talkback.
  • [ ] Languages with large words or with letters/accents not frequently used in English.
  • [ ] Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • [ ] Large and small screen sizes. (Tablet and smaller phones)
  • [ ] Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

thomashorta avatar May 17 '24 21:05 thomashorta