Skip to content

Conversation

@kean
Copy link
Contributor

@kean kean commented Mar 26, 2025

It is a requirement for Keystone.

To test:

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • 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)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@kean kean added the General label Mar 26, 2025
@kean kean added this to the 25.9 milestone Mar 26, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Mar 26, 2025

3 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 25.9. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr24316-7d00129
Version25.8
Bundle IDcom.jetpack.alpha
Commit7d00129
App Center Buildjetpack-installable-builds #10866
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr24316-7d00129
Version25.8
Bundle IDorg.wordpress.alpha
Commit7d00129
App Center BuildWPiOS - One-Offs #11843
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@kean kean requested review from crazytonyli and mokagio and removed request for mokagio March 26, 2025 15:42
mutableProperties[WPAppAnalyticsKeyPostID] = postOrPage.postID;
}
mutableProperties[WPAppAnalyticsKeyHasGutenbergBlocks] = @([postOrPage containsGutenbergBlocks]);
mutableProperties[WPAppAnalyticsKeyHasStoriesBlocks] = @([postOrPage containsStoriesBlocks]);
Copy link
Contributor

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.

Copy link
Contributor Author

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)
}
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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];
Copy link
Contributor

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?

Copy link
Contributor Author

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)
}
Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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)
}
Copy link
Contributor

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)
}
Copy link
Contributor

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?

Base automatically changed from task/extract-wpanalytics to trunk March 27, 2025 01:22
@kean kean requested a review from crazytonyli March 27, 2025 16:08
@kean kean force-pushed the task/wpanalytics-swift-2 branch from b83d217 to 431857b Compare March 27, 2025 21:09
@kean kean force-pushed the task/wpanalytics-swift-2 branch from 431857b to dc61d70 Compare March 27, 2025 21:11
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 27, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number26819
VersionPR #24316
Bundle IDcom.jetpack.alpha
Commit3e72863
Installation URL153no6gnvtqj8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 27, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number26819
VersionPR #24316
Bundle IDorg.wordpress.alpha
Commit3e72863
Installation URL7a51v0d4ff4d0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@kean kean enabled auto-merge March 28, 2025 21:25
withProperties: Constants.notificationDetailSource,
withBlogID: notification?.metaSiteID) :
CommentAnalytics.trackCommentApproved(comment: comment)
if isNotificationComment { WPAppAnalytics.track(.notificationsCommentApproved, properties: Constants.notificationDetailSource, blogID: notification?.metaSiteID)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

@kean kean added this pull request to the merge queue Mar 30, 2025
Merged via the queue into trunk with commit 50cb14f Mar 30, 2025
23 checks passed
@kean kean deleted the task/wpanalytics-swift-2 branch March 30, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants