Tvos#5
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Free Tier Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| result(windowScene.screen.maximumFramesPerSecond) | ||
| } else { | ||
| result(UIScreen.main.maximumFramesPerSecond) | ||
| } |
There was a problem hiding this comment.
Missing tvOS version in availability check causes potential crash
High Severity
The displayRefreshRate function is now compiled for tvOS (via the #else from the #if os(macOS) check), but the #available(iOS 13.0, *) check at line 765 doesn't list tvOS explicitly. In Swift, the * wildcard makes the condition always true on unlisted platforms regardless of OS version. On tvOS < 13.0, the code enters the block and accesses windowScene, which requires tvOS 13.0+, risking a runtime crash. The check needs to be #available(iOS 13.0, tvOS 13.0, *).
| result(FlutterError(code: "8", message: "Cannot collect profile: end time missing", details: nil)) | ||
| return | ||
| } | ||
| #if !os(tvOS) |
There was a problem hiding this comment.
Profiler compilation guard mismatches switch case guard
Low Severity
The switch statement guard at line 144 uses #if !os(tvOS) && !os(watchOS) to exclude profiler cases, but the method definitions at line 691 use #if !os(tvOS) only. These guards are inconsistent — on watchOS, collectProfile and discardProfiler would be compiled but never callable from the switch, resulting in dead code. The guards need to match.


📜 Description
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPiiis enabled🔮 Next steps
Note
Medium Risk
Adds tvOS-specific compilation paths for SDK init, frame tracking, and profiling APIs, which could impact platform-specific builds/behavior if conditions are wrong. Changes are mostly guarded by
#ifblocks and formatting, limiting runtime risk but increasing cross-platform compile risk.Overview
Adds explicit tvOS support to
SentryFlutterPlugin.swift, enabling auto performance tracing frame tracking and usingUIApplication-based active state checks on tvOS, while also allowing native frame metrics (beginNativeFrames/endNativeFrames) to run on tvOS.Disables profiler collection APIs on tvOS by guarding
collectProfile/discardProfilerimplementations, and refactors platform imports/displayRefreshRatecompilation branches. Also includes non-functional formatting/SwiftLint-style cleanup (indentation, multiline literals) and narrows theTimeInterval.toMilliseconds()helper tofileprivate.Written by Cursor Bugbot for commit 36f7b34. This will update automatically on new commits. Configure here.