From e905cac2d4eb6e40ce4fec8c0f6bc103bd647995 Mon Sep 17 00:00:00 2001 From: "iulianOnofrei (U-lee-aan)" <5748627+revolter@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:31:50 -0700 Subject: [PATCH] Fix infinite recursion when enabling `.graphAPIDebugInfo` logging behavior (#2245) Summary: Thanks for proposing a pull request! To help us review the request, please complete the following: - [x] sign [contributor license agreement](https://code.facebook.com/cla) - [x] I've ensured that all existing tests pass and added tests (when/where necessary) - [x] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary) - [ ] I've added the proper label to this pull request (e.g. `bug` for bug fixes) ## Pull Request Details Fixes https://github.com/facebook/facebook-ios-sdk/issues/2152. Pull Request resolved: https://github.com/facebook/facebook-ios-sdk/pull/2245 Reviewed By: ryantobinmeta Differential Revision: D59592803 Pulled By: Zhiyi-Zhang fbshipit-source-id: 3f85117961ec4342b64f83f0d9e93f170afcc7ae --- CHANGELOG.md | 2 ++ FBSDKCoreKit/FBSDKCoreKit/Settings.swift | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9820c23f7..ce148755a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## Unreleased +- Fix infinite recursion when enabling `.graphAPIDebugInfo` logging behavior. + [Full Changelog](https://github.com/facebook/facebook-ios-sdk/compare/v17.0.2...HEAD) ## 17.0.2 diff --git a/FBSDKCoreKit/FBSDKCoreKit/Settings.swift b/FBSDKCoreKit/FBSDKCoreKit/Settings.swift index a4292e2e3..914ede56b 100644 --- a/FBSDKCoreKit/FBSDKCoreKit/Settings.swift +++ b/FBSDKCoreKit/FBSDKCoreKit/Settings.swift @@ -627,7 +627,7 @@ public final class Settings: NSObject, SettingsProtocol, SettingsLogging, _Clien private func updateGraphAPIDebugBehavior() { // Enable warnings every time info is enabled - if loggingBehaviors.contains(.graphAPIDebugInfo) { + if loggingBehaviors.contains(.graphAPIDebugInfo), !loggingBehaviors.contains(.graphAPIDebugWarning) { loggingBehaviors.insert(.graphAPIDebugWarning) } }