[iOS, macOS] fix screen time watchdog crash and fire pixel when there is data on launch - #6619
Merged
samsymons merged 2 commits intoSep 1, 2026
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit de89392. Configure here.
samsymons
approved these changes
Sep 1, 2026
samsymons
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, worked as expected - thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/project/414235014887631/task/1216744184761157?focus=true
Tech Design URL:
CC:
Description
Improves Screen Time data cleanup on iOS/macOS 26 by using the dedicated system API while retaining the existing fallback. Adds daily and count telemetry when Screen Time records remain at launch, without reporting record counts or URLs.
Testing Steps
On iOS 26, disable the Screen Time cleaning feature flag.
Launch the app and visit a website.
Background and relaunch the app → screen-time_records-present daily and count pixels are emitted.
Enable the Screen Time cleaning feature flag.
Background the app to trigger cleanup.
Relaunch the app → no Screen Time records pixel is emitted.
Build the iOS Browser scheme → build succeeds.
Smoke test macOS app
Impact
High: A cleanup regression could leave browsing activity visible through Screen Time, affecting user privacy.
What could go wrong?
Screen Time records could remain after cleanup → mitigated by retaining the existing WebKit cleanup as a fallback.
The telemetry could report false positives → mitigated by checking both the dedicated Screen Time API and WebKit data stores.
Quality Considerations
Internal references:
Definition of Done | Engineering Expectations | Tech Design Template
Note
High Risk
Changes the Screen Time cleanup and detection path for privacy-sensitive browsing history; a regression could leave records visible or affect launch-time behavior, though WebKit fallback remains.
Overview
On iOS/macOS 26+,
ScreenTimeDataCleanernow tries the Screen TimeSTWebHistorypath first for both detecting and removing browsing history, and only falls back to scanning/removingWKWebsiteDataTypeScreenTimeacross WebKit data stores when that path is unavailable or fails. Public cleanup/detection APIs are no longer fully@MainActor; WebKit work stays on the main actor with cancellation checks, and the cleaner is markedSendable.Launch registers an iOS 26+ startup task that calls
hasScreenTimeData()and fires thescreen-time_records-presentpixel (daily + count) when records still exist—without URLs or counts. A matching pixel definition is added inscreen_time.json5.Reviewed by Cursor Bugbot for commit 83b6e05. Bugbot is set up for automated code reviews on this repo. Configure here.