Automattic / pocket-casts-android

Pocket Casts Android 🎧
https://forums.pocketcasts.com
Mozilla Public License 2.0
2.58k stars 222 forks source link

Tracks event for the filter list has incorrect filter count after deleting a filter #352

Open mchowning opened 2 years ago

mchowning commented 2 years ago

When deleting a filter, the tracks event for the Filters screen (filter_list_shown) that is immediately shown does not accurately reflect the deletion of the filter. Specifically, the count is what you would expect if you had not deleted a filter.

  1. Create a new filter
  2. Return to Filters screen
  3. Observe the filter count logged in Tracks: 🔵 Tracked: filter_list_shown, Properties: {"filter_count":[N],..
  4. Tap on the new filter
  5. Delete the new filter using the overflow menu
  6. 🔴 Observe that when you are returned to the Filters screen the same filter count is logged even though there is now one less filter.

h/t to @ashiagr for identifying this.

mchowning commented 2 years ago

This appears to be because of a race condition between the loading of the view and the update of the filter list from the repo. In my testing the filter list comes in about 50ms after the view is loaded.