Skip to content

Conversation

@1971123-seongmin
Copy link
Collaborator

@1971123-seongmin 1971123-seongmin commented Sep 24, 2025

🧨 Issue

  • closed #

💻 Work Description

  • 장소 등록 api 요청 시, 지번 주소가 없으면 도로명 주소,도로명 주소도 없으면 서버에 빈 문자열 전송

Summary by CodeRabbit

  • 버그 수정
    • 장소 업로드 시 기본 주소가 비어있는 경우 도로명 주소를 자동으로 사용하도록 개선했습니다. 이로써 빈 주소로 저장되던 문제를 줄이고, 서버 전송과 목록/상세 화면에서의 주소 표시가 더 정확하고 일관되게 동작합니다. 지도에서 선택한 장소 정보 누락을 방지하고, 업로드 흐름 전반의 예외 상황을 보다 부드럽게 처리합니다. 사용자 개입 없이 올바른 주소가 채워져 재시도 횟수와 입력 부담이 감소합니다.

@1971123-seongmin 1971123-seongmin self-assigned this Sep 24, 2025
@1971123-seongmin 1971123-seongmin added the FIX🔨 버그 및 오류 해결 label Sep 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 24, 2025

Walkthrough

submitUploadPlace에서 주소 매핑 로직을 변경. address가 비어있을 경우 roadAddress를 대체 값으로 사용하도록 수정. 주석 추가. 함수 시그니처나 제어 흐름 구조는 변경 없음. 서버로 전송되는 페이로드의 address 필드 값 선별 기준만 조정.

Changes

Cohort / File(s) Summary
Upload place address fallback
feature/upload/src/main/java/com/acon/acon/feature/upload/screen/UploadPlaceViewModel.kt
submitUploadPlace에서 address 선택 로직을 state.selectedSpotByMap?.address ?: state.selectedSpotByMap?.roadAddress ?: ""로 변경하여 roadAddress를 보조 값으로 사용. 관련 주석 추가. 외부 API/시그니처 변화 없음.

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 업데이트)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

토끼는 코를 씰룩, 길을 더듬네
주소가 비면, 도로명 살포시 대신해
팩트만 담아 서버로 폴짝-전송!
빈칸은 없게, 흐름도 말끔 정돈
하얀 수염 떨구며, “업로드 완료!” 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 제목은 PR의 핵심 변경사항인 "지번 주소가 없을 때 도로명 주소를 사용하고, 둘 다 없으면 빈 문자열 전송"을 명확하게 요약하고 있어 변경 내용과 일치합니다; 한 문장으로 간결하며 불필요한 단어나 이모지가 포함되어 있지 않습니다.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#259-place-upload-address-fix

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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 @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8cd1b43 and 24febb4.

📒 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

Comment on lines +349 to 353
// 지번 주소가 없으면 도로명 주소, 도로명 주소도 없으면 서버에 빈 문자열 전송
uploadRepository.submitUploadPlace(
spotName = state.selectedSpotByMap?.title ?: "",
address = state.selectedSpotByMap?.address ?: "",
address = state.selectedSpotByMap?.address ?: state.selectedSpotByMap?.roadAddress ?: "",
spotType = state.selectedSpotType ?: SpotType.CAFE,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

빈 주소 처리 미흡: 빈 문자열("")일 때 도로명 주소로 대체되지 않습니다

현재 로직은 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.

Suggested change
// 지번 주소가 없으면 도로명 주소, 도로명 주소도 없으면 서버에 빈 문자열 전송
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.

Copy link
Collaborator

@ThirFir ThirFir left a comment

Choose a reason for hiding this comment

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

합쳐주세용~

@1971123-seongmin 1971123-seongmin merged commit 3e5e7ba into develop Oct 1, 2025
2 checks passed
@ThirFir ThirFir deleted the fix/#259-place-upload-address-fix branch October 1, 2025 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FIX🔨 버그 및 오류 해결

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants