Skip to content

Commit 1432c1c

Browse files
committed
refactor: [SDK-5156] answer flag lookups instead of gating events
Follows KMP 31a7759: each event carries its own gate policy, so the host only implements IFeatureFlagReader, "is this flag on", wired to the non-forcing feature-manager read. Pins the submodule to the policy change.
1 parent 35dc0ac commit 1432c1c

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/Logging/OSObservabilityEventRecorder.swift‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public final class OSObservabilityEventRecorder: OSObservabilityEventRecorderPro
7474
// `OneSignalLog` reaches app listeners synchronously, so a listener that re-enters the
7575
// SDK would deadlock on that lock.
7676
recorder = LoggerFactory.shared.createObservabilityEventRecorder(
77-
gate: OSObservabilityEventGate(isFeatureEnabled: isFeatureEnabled),
77+
flags: OSFeatureFlagReader(isFeatureEnabled: isFeatureEnabled),
7878
logger: OSCrashLogger()
7979
)
8080
}
@@ -104,16 +104,16 @@ public final class OSObservabilityEventRecorder: OSObservabilityEventRecorderPro
104104
}
105105
}
106106

107-
/// Bridges the host's flag read to the KMP gate so the feature-key string stays on this side.
108-
private final class OSObservabilityEventGate: IObservabilityEventGate {
107+
/// Answers the KMP recorder's flag lookups; each event's own gate decides which flag to ask about.
108+
private final class OSFeatureFlagReader: IFeatureFlagReader {
109109
private let isFeatureEnabled: (String) -> Bool
110110

111111
init(isFeatureEnabled: @escaping (String) -> Bool) {
112112
self.isFeatureEnabled = isFeatureEnabled
113113
}
114114

115-
func isEnabled(event: ObservabilityEvent) -> Bool {
116-
isFeatureEnabled(event.flag.key)
115+
func isEnabled(flag: FeatureFlag) -> Bool {
116+
isFeatureEnabled(flag.key)
117117
}
118118
}
119119

0 commit comments

Comments
 (0)