wordpress-mobile / wordpress-mobile/WordPress-Android
[Analytics] Events that aren't implemented properly aren't shown as errors or crashes.
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 3.2k
- Forks
- 1.4k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 69
Description
Expected behavior
Events that aren't implemented properly should show in the log as an error or cause a crash in the debug builds.
@malinajirka made a comment about the rationale behind this in this PR discussion.
The comment :
We are showing a warning in the LogCat when the track event name isn't found: There is NO match for the event. Thinking about it now, we might want to consider crashing the app in debug builds as it's pretty easy to make such mistake - especially for newcomers.
Actual behavior
When you add an event to the Stat enum and the mapping with its value is not implemented here https://github.com/wordpress-mobile/WordPress-Android/blob/04cf520ef21257b9e75a94c4f47941235fd0ad47/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java#L598
it's simply shown as a verbose warning that could be missed.
eg.
2019-08-28 19:22:18.049 25197-25197/org.wordpress.android W/WordPress-STATS: There is NO match for the event ACCOUNT_SETTINGS_CHANGE_USERNAME_FAILEDstat
Steps to reproduce the behavior
-
Track the stat that's not implemented
AnalyticsTracker.track(ACCOUNT_SETTINGS_CHANGE_USERNAME_FAILED)
- You can then filter the log using the log level
verboseflag &WordPress-STATSas the query to see the output.
Tested on [device], Android [version], WPAndroid [version]
Google Pixel 3 XL emulator, Android 9.0, WPAndroid 13.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Stat enum in libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java and its mapping in AnalyticsTrackerNosara.java. Reproduce the missing mapping using the issue's steps and verify that an unimplemented event is reported as an error or causes a crash in debug builds instead of only producing a verbose warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- analytics, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100