-
Notifications
You must be signed in to change notification settings - Fork 121
[Woo POS][Local Catalog] Beta-fix Add Better Analytics to Background Task Refresh System #16014
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
[Woo POS][Local Catalog] Beta-fix Add Better Analytics to Background Task Refresh System #16014
Conversation
|
|
jaclync
left a comment
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.
LGTM
tested again on iPhone 16 Pro Max, iOS 18.6, and saw background_data_synced logged with the expected properties ✅ Will merge the PR once I verified the event properties in Tracks.
|
Update: beta build 23.0.0.1 is now available in TestFlight. |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
|
@joshheald 👋 this is a new crash in 23.0 from the tracking change. Do you think moving the woocommerce-ios/WooCommerce/Classes/Tools/BackgroundTasks/BackgroundTaskRefreshDispatcher.swift Lines 180 to 181 in 75aeefa
|
That's annoying. |
|
Discussion can continue in WOOMOB-1204 |

N.B. – replaces #16011, as we decided to move it to a beta fix
Description
This PR adds detailed analytics tracking to the existing background task refresh system to help us understand
how background syncing works in real-world conditions. This will inform our choices for POS local catalog sync, whether we can use the same App Refresh task or would need a background processing task.
@toupper @jaclync What do you think – 23.1, or put it in the 23.0 beta? I'm happy either way, but have done 23.1 for now.
Also, if you think there's anything else we should try to track, let me know.
Changes
Analytics Updates
System Info Collection
Analytics Properties
Steps to reproduce
- Turn Low Data Mode on/off: Settings → Cellular → Cellular Data Options → Low Data Mode
- Turn Low Power Mode on/off: Settings → Battery → Low Power Mode
- Try different networks: WiFi, Cellular, WiFi hotspot
- Run from Xcode, adding a breakpoint after the task is scheduled (at the end of AppDelegate.applicationDidEnterBackground(_:))
- In Xcode debug console, run this command:
-
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.automattic.woocommerce.refresh"]- Allow the app to run on
- Look for Tracked background_data_synced in the logs
- Make sure all the properties show up and look correct:
network_typeshould show your current connectionis_low_data_modeshould match what you set in Settingsis_low_power_modeshould match what you set in Settingsbattery_levelshould show current battery percentageis_poweredshould show if you're chargingbackground_time_grantedwon't be logged, because the app is essentially in the foreground even when you background it.- WiFi with/without Low Data Mode
- Cellular with/without roaming (if you can)
- Different battery levels and charging states
- Run while app is in background vs foreground
Expected Results
Analytics should show detailed info like:
Testing information
I've tested this on an iPhone running iOS 18, with both simulated and real BGAppRefreshTasks. Screenshot below shows a real task's logged result.
Screenshots
RELEASE-NOTES.txtif necessary.