Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,11 @@
return "debug";
}
SentryMobileProvisionParser *parser = [[SentryMobileProvisionParser alloc] init];
if ([[parser apsEnvironment] isEqualToString:@"development"] && [parser getTaskAllow]) {
return "debug";
}
if ([parser hasEmbeddedMobileProvisionProfile]) {
return [parser mobileProvisionProfileProvisionsAllDevices] ? "enterprise" : "adhoc";
return [parser provisionsAllDevices] ? "enterprise" : "adhoc";
}
if (isTestBuild()) {
return "test";
Expand Down
17 changes: 9 additions & 8 deletions Sources/Swift/Helper/SentryMobileProvisionParser.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
@objc @_spi(Private)
public class SentryMobileProvisionParser: NSObject {
private var provisionsAllDevices: Bool = false
private var embeddedProfilePath: String?


public final class SentryMobileProvisionParser: NSObject {
// If the profile provisions all devices, it indicates Enterprise distribution
@objc
public var mobileProvisionProfileProvisionsAllDevices: Bool {
return provisionsAllDevices
}
@objc public private(set) var provisionsAllDevices: Bool = false
private var embeddedProfilePath: String?
@objc public private(set) var apsEnvironment: String?
@objc public private(set) var getTaskAllow: Bool = false

// This convenience initializer exists so we can use it from ObjC.
// Functions with Optional parameters (used for testing) are not available to ObjC
Expand Down Expand Up @@ -58,6 +56,9 @@ public class SentryMobileProvisionParser: NSObject {
let dict = obj as? [String: Any] else {
return
Copy link

Choose a reason for hiding this comment

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

Bug: Tests use an old, non-existent property name, causing compilation errors.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The property mobileProvisionProfileProvisionsAllDevices was renamed to provisionsAllDevices in SentryMobileProvisionParser. While the Objective-C code was updated, 11 references in SentryMobileProvisionParserTests.swift still use the old property name. This will cause compilation errors in the test file, preventing the project from building successfully.

💡 Suggested Fix

Update all 11 occurrences of parser.mobileProvisionProfileProvisionsAllDevices in SentryMobileProvisionParserTests.swift to parser.provisionsAllDevices.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: Sources/Swift/Helper/SentryMobileProvisionParser.swift#L57

Potential issue: The property `mobileProvisionProfileProvisionsAllDevices` was renamed
to `provisionsAllDevices` in `SentryMobileProvisionParser`. While the Objective-C code
was updated, 11 references in `SentryMobileProvisionParserTests.swift` still use the old
property name. This will cause compilation errors in the test file, preventing the
project from building successfully.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5544207

}
let entitlements = (dict["Entitlements"] as? Dictionary<AnyHashable, Any>)
getTaskAllow = entitlements?["get-task-allow"] as? Int == 1
apsEnvironment = entitlements?["aps-environment"] as? String
provisionsAllDevices = dict["ProvisionsAllDevices"] as? Bool ?? false
}
}
Loading