Closed jaclync closed 1 year ago
Fixes #262
Recently, we noticed a Tracks event wasn't actually tracked due to a validation error that wasn't logged anywhere in the console p1693362956666449/1692625489.705669-slack-C039133E1M3 / https://github.com/woocommerce/woocommerce-ios/issues/10574.
https://github.com/Automattic/Automattic-Tracks-iOS/blob/aad902bf945e7528a00ba5b9c5640974d58ff2fd/Sources/Event%20Logging/TracksEventService.m#L59-L61
Upon inspection, TracksLoggingClass() is nil when the library is integrated with the client app via Cocoapods:
TracksLoggingClass()
nil
https://github.com/Automattic/Automattic-Tracks-iOS/blob/aad902bf945e7528a00ba5b9c5640974d58ff2fd/Sources/Model/ObjC/Common/TracksLogging.m#L6-L18
I'm guessing the Cocoapods path wasn't tested, and thus Tracks logging has been disabled for a while.
To fix the nil TracksLoggingClass(), the logging class was updated to include the module name so that the class can be loaded correctly https://github.com/Automattic/Automattic-Tracks-iOS/commit/7dd7d5dd82f512cec17cef1edef94400e15a35e4.
For easier debugging, the event name is now included in the warning message when there is a validation error creating a Tracks event https://github.com/Automattic/Automattic-Tracks-iOS/commit/bce4ea9845abaedde23f0db7d02721b446f2a580.
To enable the client app to log a different message on Tracks event creation error, a success boolean is returned when creating an event with custom properties https://github.com/Automattic/Automattic-Tracks-iOS/commit/a9bfbbc02049d07cbe7f716bac2a156e7abb694f. The return value is default to be discardable in Objective-C.
Please follow the testing steps in https://github.com/woocommerce/woocommerce-ios/pull/10577.
CHANGELOG.md
Fixes #262
Why
Recently, we noticed a Tracks event wasn't actually tracked due to a validation error that wasn't logged anywhere in the console p1693362956666449/1692625489.705669-slack-C039133E1M3 / https://github.com/woocommerce/woocommerce-ios/issues/10574.
https://github.com/Automattic/Automattic-Tracks-iOS/blob/aad902bf945e7528a00ba5b9c5640974d58ff2fd/Sources/Event%20Logging/TracksEventService.m#L59-L61
Upon inspection,
TracksLoggingClass()
isnil
when the library is integrated with the client app via Cocoapods:https://github.com/Automattic/Automattic-Tracks-iOS/blob/aad902bf945e7528a00ba5b9c5640974d58ff2fd/Sources/Model/ObjC/Common/TracksLogging.m#L6-L18
I'm guessing the Cocoapods path wasn't tested, and thus Tracks logging has been disabled for a while.
How
To fix the
nil
TracksLoggingClass()
, the logging class was updated to include the module name so that the class can be loaded correctly https://github.com/Automattic/Automattic-Tracks-iOS/commit/7dd7d5dd82f512cec17cef1edef94400e15a35e4.For easier debugging, the event name is now included in the warning message when there is a validation error creating a Tracks event https://github.com/Automattic/Automattic-Tracks-iOS/commit/bce4ea9845abaedde23f0db7d02721b446f2a580.
To enable the client app to log a different message on Tracks event creation error, a success boolean is returned when creating an event with custom properties https://github.com/Automattic/Automattic-Tracks-iOS/commit/a9bfbbc02049d07cbe7f716bac2a156e7abb694f. The return value is default to be discardable in Objective-C.
Testing steps
Please follow the testing steps in https://github.com/woocommerce/woocommerce-ios/pull/10577.
CHANGELOG.md
if necessary.