-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Rewrite WPAppAnalytics extensions in Swift #24316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Generated by 🚫 Danger |
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr24316-7d00129 | |
| Version | 25.8 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 7d00129 | |
| App Center Build | jetpack-installable-builds #10866 |
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr24316-7d00129 | |
| Version | 25.8 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 7d00129 | |
| App Center Build | WPiOS - One-Offs #11843 |
| mutableProperties[WPAppAnalyticsKeyPostID] = postOrPage.postID; | ||
| } | ||
| mutableProperties[WPAppAnalyticsKeyHasGutenbergBlocks] = @([postOrPage containsGutenbergBlocks]); | ||
| mutableProperties[WPAppAnalyticsKeyHasStoriesBlocks] = @([postOrPage containsStoriesBlocks]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line appears to be removed in the translation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed both WPAppAnalyticsKeyHasStoriesBlocks because stories have been removed from the app in general about a year ago or more.
|
|
||
| if let railcar { | ||
| WPAppAnalytics.trackTrainTracksInteraction(.trainTracksInteract, withProperties: railcar) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this "railcar" is, but do we just not care about it anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's something that was added nine years ago and appears to be unused. Posts don't have railcars, and I couldn't find any recent events on Tracks either. I think it's pretty safe to say it's dead code.
| * @brief Timestamp of the app's opening time. | ||
| */ | ||
| @property (nonatomic, strong, readwrite) NSDate* applicationOpenedTime; | ||
| @property (nonatomic, strong, readwrite) NSDate* _Nullable applicationOpenedTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: adding nonnull to the property attributes instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah forgot it about. Updated. It's much nicer.
| } else { | ||
| [self setUserHasOptedOutValue:NO]; | ||
| } | ||
| [self setUserHasOptedOutValue:NO]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional to delete the code above that reads user settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the migration code that I assume we no longer need. This runs once.
| WPAppAnalytics.track(.siteSettingsExportSiteRequested, with: trackedBlog) | ||
| if let trackedBlog { | ||
| WPAppAnalytics.track(.siteSettingsExportSiteRequested, blog: trackedBlog) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add an else block which runs WPAppAnalytics.track(.siteSettingsExportSiteRequested) here? Same as the if let trackedBlog statements below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I made blog optional in WPAppAnalytics for convenience and updated all of these method invocations.
| withProperties: Constants.notificationDetailSource, | ||
| withBlogID: notification?.metaSiteID) : | ||
| CommentAnalytics.trackCommentUnApproved(comment: comment) | ||
| if isNotificationComment { WPAppAnalytics.track(.notificationsCommentUnapproved, properties: Constants.notificationDetailSource, blogID: notification?.metaSiteID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement should be in a new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| WPAppAnalytics.track(.mediaLibraryDeletedItems, withProperties: ["number_of_items_deleted": deletedItemsCount], with: self?.blog) | ||
| if let blog = self?.blog { | ||
| WPAppAnalytics.track(.mediaLibraryDeletedItems, properties: ["number_of_items_deleted": deletedItemsCount], blog: blog) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding an else block to call WPAppAnalytics.track(.mediaLibraryDeletedItems)?
| WPAppAnalytics.track(.themesChangedTheme, withProperties: ["theme_id": theme?.themeId ?? ""], with: self?.blog) | ||
| if let blog = self?.blog { | ||
| WPAppAnalytics.track(.themesChangedTheme, properties: ["theme_id": theme?.themeId ?? ""], blog: blog) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the above, adding an else block here?
b83d217 to
431857b
Compare
431857b to
dc61d70
Compare
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 26819 | |
| Version | PR #24316 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 3e72863 | |
| Installation URL | 153no6gnvtqj8 |
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 26819 | |
| Version | PR #24316 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 3e72863 | |
| Installation URL | 7a51v0d4ff4d0 |
| withProperties: Constants.notificationDetailSource, | ||
| withBlogID: notification?.metaSiteID) : | ||
| CommentAnalytics.trackCommentApproved(comment: comment) | ||
| if isNotificationComment { WPAppAnalytics.track(.notificationsCommentApproved, properties: Constants.notificationDetailSource, blogID: notification?.metaSiteID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here needs a new line too.
| func spamComment() { | ||
| isNotificationComment ? WPAppAnalytics.track(.notificationsCommentFlaggedAsSpam, withBlogID: notification?.metaSiteID) : | ||
| CommentAnalytics.trackCommentSpammed(comment: comment) | ||
| if isNotificationComment { WPAppAnalytics.track(.notificationsCommentFlaggedAsSpam, blogID: notification?.metaSiteID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
| func trashComment() { | ||
| isNotificationComment ? WPAppAnalytics.track(.notificationsCommentTrashed, withBlogID: notification?.metaSiteID) : | ||
| CommentAnalytics.trackCommentTrashed(comment: comment) | ||
| if isNotificationComment { WPAppAnalytics.track(.notificationsCommentTrashed, blogID: notification?.metaSiteID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.


It is a requirement for Keystone.
To test:
Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txtif necessary.Testing checklist: