-
Notifications
You must be signed in to change notification settings - Fork 0
fix: 장소 등록 api 요청 시, 지번 주소가 없으면 도로명 주소,도로명 주소도 없으면 서버에 빈 문자열 전송 #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughsubmitUploadPlace에서 주소 매핑 로직을 변경. address가 비어있을 경우 roadAddress를 대체 값으로 사용하도록 수정. 주석 추가. 함수 시그니처나 제어 흐름 구조는 변경 없음. 서버로 전송되는 페이로드의 address 필드 값 선별 기준만 조정. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant VM as UploadPlaceViewModel
participant S as Server API
U->>VM: 제출 액션(trigger submitUploadPlace)
VM->>VM: 주소 선택<br/>(address ? address : roadAddress ? roadAddress : "")
alt 주소 선택 성공
VM->>S: 업로드 요청(payload.address = 선택된 주소)
S-->>VM: 응답(성공/실패)
else 주소 미존재(빈 문자열)
VM->>S: 업로드 요청(payload.address = "")
S-->>VM: 응답(성공/실패)
end
VM-->>U: 결과 반영(UI 업데이트)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
feature/upload/src/main/java/com/acon/acon/feature/upload/screen/UploadPlaceViewModel.kt (2)
351-351: spotName도 공백 방어 로직 권장이 PR 범위는 아니지만,
spotName도 공백 문자열이 들어갈 수 있다면 동일하게 방어하는 것이 안전합니다.- spotName = state.selectedSpotByMap?.title ?: "", + spotName = state.selectedSpotByMap?.title?.takeUnless { it.isBlank() } ?: "",
349-349: 주석 업데이트 제안코드가 공백까지 처리하도록 변경되면, 주석도 “없으면(또는 공백이면)”으로 명확히 하는 것을 권장합니다.
- // 지번 주소가 없으면 도로명 주소, 도로명 주소도 없으면 서버에 빈 문자열 전송 + // 지번 주소가 없거나 공백이면 도로명 주소, 도로명 주소도 없거나 공백이면 서버에 빈 문자열 전송
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
feature/upload/src/main/java/com/acon/acon/feature/upload/screen/UploadPlaceViewModel.kt(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
| // 지번 주소가 없으면 도로명 주소, 도로명 주소도 없으면 서버에 빈 문자열 전송 | ||
| uploadRepository.submitUploadPlace( | ||
| spotName = state.selectedSpotByMap?.title ?: "", | ||
| address = state.selectedSpotByMap?.address ?: "", | ||
| address = state.selectedSpotByMap?.address ?: state.selectedSpotByMap?.roadAddress ?: "", | ||
| spotType = state.selectedSpotType ?: SpotType.CAFE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빈 주소 처리 미흡: 빈 문자열("")일 때 도로명 주소로 대체되지 않습니다
현재 로직은 null만 처리해 Elvis가 동작합니다. address=""(혹은 공백)인 경우 그대로 ""가 전송되어 요구사항(비어있으면 roadAddress, 둘 다 비면 빈 문자열)과 불일치합니다. 공백 포함 빈값까지 처리하도록 수정이 필요합니다.
- address = state.selectedSpotByMap?.address ?: state.selectedSpotByMap?.roadAddress ?: "",
+ address = state.selectedSpotByMap?.address?.takeUnless { it.isBlank() }
+ ?: state.selectedSpotByMap?.roadAddress?.takeUnless { it.isBlank() }
+ ?: "",📝 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.
| // 지번 주소가 없으면 도로명 주소, 도로명 주소도 없으면 서버에 빈 문자열 전송 | |
| uploadRepository.submitUploadPlace( | |
| spotName = state.selectedSpotByMap?.title ?: "", | |
| address = state.selectedSpotByMap?.address ?: "", | |
| address = state.selectedSpotByMap?.address ?: state.selectedSpotByMap?.roadAddress ?: "", | |
| spotType = state.selectedSpotType ?: SpotType.CAFE, | |
| // 지번 주소가 없으면 도로명 주소, 도로명 주소도 없으면 서버에 빈 문자열 전송 | |
| uploadRepository.submitUploadPlace( | |
| spotName = state.selectedSpotByMap?.title ?: "", | |
| address = state.selectedSpotByMap?.address?.takeUnless { it.isBlank() } | |
| ?: state.selectedSpotByMap?.roadAddress?.takeUnless { it.isBlank() } | |
| ?: "", | |
| spotType = state.selectedSpotType ?: SpotType.CAFE, |
🤖 Prompt for AI Agents
In
feature/upload/src/main/java/com/acon/acon/feature/upload/screen/UploadPlaceViewModel.kt
around lines 349 to 353, the current Elvis operator only handles nulls so an
empty or whitespace-only address ("" or " ") will be sent as-is; update the
logic to treat blank strings as missing by using isNullOrBlank checks (e.g.,
prefer selectedSpotByMap?.address.takeIf { !it.isNullOrBlank() } ?:
selectedSpotByMap?.roadAddress.takeIf { !it.isNullOrBlank() } ?: "") so the code
sends the roadAddress when address is blank and otherwise falls back to empty
string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
합쳐주세용~
🧨 Issue
💻 Work Description
Summary by CodeRabbit