Add Media Library upload data types and tracker events#25619
Add Media Library upload data types and tracker events#25619crazytonyli wants to merge 2 commits into
Conversation
Generated by 🚫 Danger |
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
a34822c to
35848ab
Compare
1b5f4d8 to
26d3fb8
Compare
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32692 | |
| Version | PR #25619 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 655eccc | |
| Installation URL | 106j20csb5fk8 |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32692 | |
| Version | PR #25619 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 655eccc | |
| Installation URL | 2i2d7pbu1kht0 |
26d3fb8 to
a4390f8
Compare
35848ab to
dad690b
Compare
4e19015 to
486c1bf
Compare
Module-side foundation for the V2 upload pipeline: the upload source and policy value types, the in-flight/failed/state models, the transport protocol over the wp_mobile upload call, and the new tracker event cases. Bumps wordpress-rs to 0.4.0 for the create-media API the transport calls.
486c1bf to
de0286a
Compare
| // .audio / .document map to no event — V1 parity. | ||
| return | ||
| } | ||
| WPAppAnalytics.track(resolvedStat, properties: baseProperties, blog: blog) |
There was a problem hiding this comment.
media_origin is dropped here. V1 attaches it to these same events via selectionMethod — full_screen_picker for photoLibrary/camera, document_picker for otherApps — but only the .stockPhotos branch sets it. Device/camera/otherApps adds lose the dimension vs V1.
| let trackedEventNames = TestAnalyticsTracker.tracked.map(\.event) | ||
| let trackedStats = TestAnalyticsTracker.tracked.map(\.stat) | ||
| #expect(!trackedEventNames.contains("media_library_photo_added")) | ||
| #expect(!trackedStats.contains(.mediaLibraryAddedPhotoViaStockPhotos)) |
There was a problem hiding this comment.
trackedEventNames is always "" (the adapter only does stat-based tracking), so this assertion can never fail. Assert nothing fired instead:
| let trackedEventNames = TestAnalyticsTracker.tracked.map(\.event) | |
| let trackedStats = TestAnalyticsTracker.tracked.map(\.stat) | |
| #expect(!trackedEventNames.contains("media_library_photo_added")) | |
| #expect(!trackedStats.contains(.mediaLibraryAddedPhotoViaStockPhotos)) | |
| #expect(TestAnalyticsTracker.tracked.isEmpty) |
|
|
||
| static let uploadBannerUploadingOnly = NSLocalizedString( | ||
| "mediaLibrary.upload.banner.uploadingOnly", | ||
| value: "Uploading %1$d items", |
There was a problem hiding this comment.
Renders "Uploading 1 items" for a single upload — needs singular/plural handling (.stringsdict or a count == 1 branch).
| ) | ||
| static let uploadBannerFailedOnly = NSLocalizedString( | ||
| "mediaLibrary.upload.banner.failedOnly", | ||
| value: "%1$d upload failed", |
There was a problem hiding this comment.
Inverse plural bug — "2 upload failed" for >1. Same singular/plural handling as the uploading banner.
| value: "All in-progress uploads will be cancelled. This can't be undone.", | ||
| comment: "Body of the confirmation alert shown before canceling every in-flight upload." | ||
| ) | ||
| static let cancel = NSLocalizedString( |
There was a problem hiding this comment.
cancel maps to "Keep uploading", but the repo names alert buttons by their text (cf. notNow, cancellationAlertContinueEditing), so this reads as the destructive action — which is actually uploadBulkCancelAllConfirm ("Cancel uploads"). Suggest renaming:
| static let cancel = NSLocalizedString( | |
| static let keepUploading = NSLocalizedString( |
Attach media_origin to device/camera/file-picker added events for V1 parity, tighten the Image Playground analytics test, and fix the upload banner pluralization and the bulk-cancel button name.
|
Version |


Note
This PR will be merged after #25618.