fix: 코스 생성 시 GPS 경로 전체를 로그에 남기던 코드 제거 (dev) - #232
Conversation
dev/main 브랜치 정합성을 점검하다가, main엔 이미 fix/course-path-log-pii(#200)로 고쳐진 문제가 dev엔 반영이 안 돼 있었을 뿐 아니라, 오히려 유저의 실제 GPS 좌표 전체를 log.info로 그대로 남기는 코드가 남아있는 걸 발견했다. main의 안전한 버전 (에러 시에도 좌표값 자체는 로그에 안 남기고 size/type/메시지만 남김)으로 맞췄다.
📝 WalkthroughWalkthroughThe converter now emits one structured warning for conversion failures. The ChangesCoordinate path conversion
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java`:
- Line 21: Update the failure logging in CoordinatePathConverter so the catch
handler remains null-safe when path is null. Replace direct path.size() and
path.getClass() access with null-safe size and type values, or validate path
before getLineString(path), while preserving the intended BadRequestException
flow.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2aea820a-6e5d-482a-a938-b7a945e6a8fe
📒 Files selected for processing (1)
src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java
| } catch (Exception e) { | ||
| log.warn("course 요청 데이터 값 (path) -> " + path); | ||
| log.warn("course 요청 데이터 값의 타입 (path) -> " + path.getClass().getName()); | ||
| log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}", path.size(), path.getClass().getName(), e.getMessage()); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Keep failure logging null-safe.
When path is null, getLineString(path) fails first, but the catch block then evaluates path.size() and path.getClass(). The handler throws NullPointerException instead of the intended BadRequestException.
Use null-safe size/type values or validate path before conversion.
Proposed fix
- log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}", path.size(), path.getClass().getName(), e.getMessage());
+ log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}",
+ path == null ? null : path.size(),
+ path == null ? "null" : path.getClass().getName(),
+ e.getMessage());📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}", path.size(), path.getClass().getName(), e.getMessage()); | |
| log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}", | |
| path == null ? null : path.size(), | |
| path == null ? "null" : path.getClass().getName(), | |
| e.getMessage()); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java`
at line 21, Update the failure logging in CoordinatePathConverter so the catch
handler remains null-safe when path is null. Replace direct path.size() and
path.getClass() access with null-safe size and type values, or validate path
before getLineString(path), while preserving the intended BadRequestException
flow.
작업 배경
dev/main 브랜치 정합성을 점검하다가, 개인정보(GPS 경로) 로깅 관련 실제 취약점을 발견했다.
변경 사항
CoordinatePathConverter.javalog.info로 남기던 코드 제거, main의 안전한 버전으로 교체영향 범위
fix/course-path-log-pii(fix: 코스 생성 시 GPS 경로 전체를 로그에 남기던 코드 제거 #200)로 이 문제가 수정됐는데, dev는 그 수정을 반영받지 못했을 뿐 아니라 오히려 좌표 전체((lat, lng)쌍 전부)를log.info(sb.toString())으로 명시적으로 남기는 코드가 추가돼 있었음 — 지금 dev 환경에서 코스를 생성할 때마다 유저의 실제 러닝 경로가 서버 로그에 그대로 남고 있던 상태.size/type/에러 메시지만 로그에 남도록 main과 동일하게 맞춤 — 정상 동작(로직 자체)은 변경 없음.Test Plan
./gradlew compileJava성공./gradlew test전체 251/251 통과🤖 Generated with Claude Code
Summary by CodeRabbit