Skip to content

1.9.5#54

Open
minhyeok4dev wants to merge 2 commits intomasterfrom
dev-1.9.5
Open

1.9.5#54
minhyeok4dev wants to merge 2 commits intomasterfrom
dev-1.9.5

Conversation

@minhyeok4dev
Copy link
Contributor

@minhyeok4dev minhyeok4dev commented Jan 8, 2026

Summary by CodeRabbit

릴리스 노트

  • 버그 수정

    • JavaScript 메시지 처리 및 API 요청/응답 시 JSON 유효성 검증 강화로 안정성 향상
  • 개선 사항

    • 사용자 인터페이스 레이아웃 조정으로 화면 정렬 개선
    • 내장 웹 컨텐츠 로드 대상 업데이트
  • 기타

    • SDK 버전이 1.9.5로 업데이트됨

✏️ Tip: You can customize this high-level summary in your review settings.

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Walkthrough

프로젝트 파일 참조 ID 갱신, 스토리보드 레이아웃 조정, JavaScript/네트워크 JSON 검증 추가 및 웹뷰 기본 URL 변경을 포함한 메타·안정성 관련 변경입니다. 기능적 동작에는 본질적 변화가 없습니다.

Changes

Cohort / File(s) 요약
프로젝트 설정
.gitignore, Example/FlareLane.xcodeproj/project.pbxproj
.gitignore의 공백 정리 및 Xcode 프로젝트 내 GoogleService-Info.plist 파일 참조 ID와 관련 교차 참조 업데이트
UI 및 웹뷰
Example/FlareLane/Base.lproj/Main.storyboard, Example/FlareLane/WebViewController.swift
스토리보드 툴버전·프레임(위치/크기) 조정; WebView가 로드하는 URL을 https://minhyeok4dev.github.io/https://www.lotteimall.com/으로 변경
JSON 검증 강화
Sources/FlareLaneSwift/FlareLaneJavascriptInterface.swift, Sources/FlareLaneSwift/InAppMessageJavascriptInterface.swift, Sources/FlareLaneSwift/Request.swift
WKScriptMessage 및 요청/응답 바디에 대해 JSONSerialization.isValidJSONObject 기반 유효성 검사 추가 및 파싱 경로에서 실패 시 조기 반환/오류 로깅 도입
버전 업데이트
FlareLane.podspec, Sources/FlareLaneSwift/Globals.swift
SDK/패키지 버전 표기 1.9.41.9.5로 상향

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • 1.9.4 #52 — 동일한 Globals.sdkVersion 및 podspec 버전 변경과 관련된 메타데이터 업데이트.

Poem

🐇🌿
참조 ID는 살며시 바꾸고, 프레임은 살짝 옮겼네,
자바스크립트 몸값을 검사해 안전의 울타리 세우고,
웹뷰는 먼 곳으로 한 걸음 나아가네.
토끼가 축하해요 — 작은 정리가 큰 평화를! 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive 제목이 버전 번호만 포함하고 있어 변경 사항의 실제 내용을 명확하게 설명하지 못합니다. 버전 업데이트, JSON 유효성 검사 추가, 레이아웃 조정 등 주요 변경 사항을 포함하는 더 구체적인 제목으로 변경하세요. 예: 'v1.9.5: JSON 유효성 검사 추가 및 SDK 버전 업데이트'
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0f5d2c and bd90b34.

⛔ Files ignored due to path filters (1)
  • Example/Podfile.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • FlareLane.podspec
  • Sources/FlareLaneSwift/Globals.swift
🔇 Additional comments (2)
FlareLane.podspec (1)

11-11: 버전 업데이트가 올바르게 적용되었습니다.

podspec의 버전이 '1.9.5'로 정확하게 업데이트되었으며, Sources/FlareLaneSwift/Globals.swift의 내부 SDK 버전과 일치합니다.

Sources/FlareLaneSwift/Globals.swift (1)

17-17: SDK 버전이 올바르게 업데이트되었습니다.

내부 SDK 버전이 "1.9.5"로 정확하게 업데이트되었으며, FlareLane.podspec의 버전과 일치합니다.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
Sources/FlareLaneSwift/Request.swift (1)

54-72: nil 값이 포함된 요청 본문 처리 시 문제 발생 가능

getRequestWithBody 함수의 body 파라미터 타입이 [String: Any?]인데, 60-63라인에서 추가된 JSONSerialization.isValidJSONObject(body) 검증은 Swift의 nil 값을 포함한 딕셔너리를 거부합니다.

Swift의 nil은 JSON으로 직렬화할 수 없으므로 (JSON null은 NSNull이어야 함), 선택적 필드를 생략하기 위해 의도적으로 nil을 사용하는 정상적인 API 호출이 실패할 수 있습니다.

예시:

let body: [String: Any?] = ["userId": nil, "tags": ["key": "value"]]
// isValidJSONObject는 false를 반환하여 요청이 거부됨
🔧 제안하는 수정 방안

nil 값을 필터링하거나 NSNull로 변환하는 로직을 추가하세요:

 func getRequestWithBody(method: WithBodyMethod, path: String, body: [String: Any?]) -> URLRequest? {
   guard let baseURL = self.getBaseURL(),
         let url = URL(string: "\(baseURL)\(path)") else {
     return nil
   }
   
+  // nil 값을 제거하여 유효한 JSON 객체 생성
+  let cleanedBody = body.compactMapValues { $0 }
+  
-  guard JSONSerialization.isValidJSONObject(body) else {
-    Logger.error("Invalid JSON object in request body: \(body)")
+  guard JSONSerialization.isValidJSONObject(cleanedBody) else {
+    Logger.error("Invalid JSON object in request body: \(cleanedBody)")
     return nil
   }
   
   var request = URLRequest(url: url)
   request.httpMethod = method.rawValue
-  request.httpBody = try? JSONSerialization.data(withJSONObject: body, options: [])
+  request.httpBody = try? JSONSerialization.data(withJSONObject: cleanedBody, options: [])
   request.addValue("application/json", forHTTPHeaderField: "Content-Type")
   request.setValue(self.getRequestSDKInfoHeaderValue(), forHTTPHeaderField: "x-flarelane-sdk-info")
   
   return request
 }

또는 nil을 JSON null로 변환하려면:

// nil을 NSNull로 변환
let cleanedBody = body.mapValues { $0 ?? NSNull() }
Sources/FlareLaneSwift/FlareLaneJavascriptInterface.swift (1)

43-62: Swift nil 값이 JSON으로 직렬화되지 않아 정상 케이스에서 실패합니다.

syncDeviceData의 data 딕셔너리에 포함된 projectIdInUserDefaults, deviceIdInUserDefaults, userIdInUserDefaults는 모두 String? 타입(옵셔널)입니다. 이 값들이 nil일 때, Swift의 nil은 JSON null(NSNull)로 변환되지 않으므로 JSONSerialization.isValidJSONObject(data)가 false를 반환하여 정상적인 경우(초기화 후 값이 설정되지 않은 상황)에도 "Invalid JSON object" 에러가 발생하고 데이터 동기화가 실패합니다.

nil 값을 NSNull로 변환하거나 dictionary 생성 시 nil 값을 제외하는 방식으로 수정이 필요합니다.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e7db47e and c0f5d2c.

📒 Files selected for processing (7)
  • .gitignore
  • Example/FlareLane.xcodeproj/project.pbxproj
  • Example/FlareLane/Base.lproj/Main.storyboard
  • Example/FlareLane/WebViewController.swift
  • Sources/FlareLaneSwift/FlareLaneJavascriptInterface.swift
  • Sources/FlareLaneSwift/InAppMessageJavascriptInterface.swift
  • Sources/FlareLaneSwift/Request.swift
🧰 Additional context used
🧬 Code graph analysis (3)
Sources/FlareLaneSwift/FlareLaneJavascriptInterface.swift (1)
Sources/FlareLaneSwift/Logger.swift (1)
  • error (22-26)
Sources/FlareLaneSwift/Request.swift (1)
Sources/FlareLaneSwift/Logger.swift (1)
  • error (22-26)
Sources/FlareLaneSwift/InAppMessageJavascriptInterface.swift (1)
Sources/FlareLaneSwift/Logger.swift (1)
  • error (22-26)
🔇 Additional comments (11)
Sources/FlareLaneSwift/InAppMessageJavascriptInterface.swift (1)

36-41: LGTM! 견고한 JSON 검증 추가

JavaScript에서 전달되는 메시지의 유효성을 검증하는 로직이 추가되어 잘못된 형식의 데이터가 처리되는 것을 방지합니다. 방어적 프로그래밍 관점에서 적절한 개선사항입니다.

Sources/FlareLaneSwift/FlareLaneJavascriptInterface.swift (1)

19-24: LGTM! JavaScript 메시지 검증 강화

userContentController에서 받은 메시지의 JSON 유효성을 검증하여 잘못된 데이터 처리를 방지합니다. 적절한 개선사항입니다.

Sources/FlareLaneSwift/Request.swift (4)

92-98: LGTM! 응답 데이터 검증 강화

GET 응답의 JSON 유효성 검증이 추가되어 잘못된 형식의 서버 응답을 처리하기 전에 조기에 감지할 수 있습니다. 적절한 방어 로직입니다.


122-128: LGTM! POST 응답 검증 추가

POST 응답에 대한 JSON 유효성 검증이 추가되어 서버로부터 받은 데이터의 무결성을 보장합니다.


155-161: LGTM! PATCH 응답 검증 추가

PATCH 응답에 대한 JSON 검증이 일관되게 적용되었습니다.


188-194: LGTM! DELETE 응답 검증 추가

DELETE 응답에 대한 JSON 검증이 추가되어 모든 HTTP 메서드에서 일관된 응답 검증이 이루어집니다.

Example/FlareLane/WebViewController.swift (1)

35-35: 예제 앱에서 외부 상용 사이트 URL 사용 의도 확인 필요

WebView가 로드하는 URL이 롯데아이몰(https://www.lotteimall.com/)로 설정되어 있습니다. 이 URL은 코드베이스 내에서 이 위치에만 참조되고 있으며, 예제 앱에서 외부 상용 전자상거래 사이트를 로드하도록 하는 것이 의도된 것인지 확인이 필요합니다. 예제 코드에 특정 외부 사이트의 URL을 하드코딩하면 외부 사이트에 대한 의존성이 생기고 사이트 장애 시 예제가 동작하지 않을 수 있으므로, 이 변경의 의도를 명확히 해주세요.

Example/FlareLane/Base.lproj/Main.storyboard (3)

2-6: Xcode 도구 버전 정상화

toolsVersion이 비정상적인 값(32700.99.1234)에서 안정적인 버전(24506)으로 변경되었습니다. 이는 이전에 잘못 설정되었거나 베타 버전의 Xcode를 사용했던 것을 수정한 것으로 보입니다. 이 변경은 프로젝트의 호환성과 안정성을 개선합니다.


24-88: 레이아웃 자동 조정

버튼 프레임 좌표들이 Xcode 도구 버전 변경에 따라 자동으로 재계산되었습니다. 모든 UI 요소의 상대적 위치는 유지되며, 기능적 변경은 없습니다.


120-153: 뷰 프레임 높이 조정

WebView 관련 씬들의 프레임 높이가 842에서 793으로 조정되었습니다. 이는 도구 버전 변경에 따른 자동 조정으로 보입니다.

Example/FlareLane.xcodeproj/project.pbxproj (1)

24-370: GoogleService-Info.plist 참조 ID 업데이트

GoogleService-Info.plist 파일의 내부 Xcode 참조 ID가 업데이트되었습니다 (040A273D2C14BE5E00419F35 → 7FAC7BD52F0E406C00A4F063). 파일 경로와 기능은 동일하게 유지되며, 이는 표준적인 프로젝트 유지보수 작업입니다.

모든 관련 섹션(PBXBuildFile, PBXFileReference, PBXGroup, PBXResourcesBuildPhase)이 일관되게 업데이트되었습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant