WordPress-Android
WordPress-Android copied to clipboard
[Tags Feed] Fix duplicate tracking in Reader subfilter
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:
- Install Jetpack
- Make sure
App Setting
->Privacy
->Collect Information
is enabled - Make sure
reader_tags_feed
Feature config is enabled (Debug Settings
->Remote Features
- Go to Reader
- Go to Subscriptions
-
Verify
reader_filter_sheet_item_selected
is not tracked - Tap the subfilter pill
- Verify appropriate events are tracked ONLY ONCE
- Tap a Site
-
Verify
reader_filter_sheet_item_selected
is tracked ONLY ONCE - Tap the pill again
- Repeat 9-11 multiple times making sure events are tracked ONLY ONCE per trigger
- Go to Your Tags
- Repeat 6-12
Regression Notes
-
Potential unintended areas of impact
- N/A
-
What I did to test those areas of impact (or what existing automated tests I relied on)
- N/A
-
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
- Unit tests not added for the one-time initialization mechanism since it is done completely in Fragment and ViewModel non-exposed APIs (
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)