Skip to content

[fix] 배포 서버에서 로그인,유저 정보 조회 관련 에러 해결 #104

Merged
KiSeungMin merged 4 commits into
developfrom
feature/seungin
Aug 6, 2025
Merged

[fix] 배포 서버에서 로그인,유저 정보 조회 관련 에러 해결 #104
KiSeungMin merged 4 commits into
developfrom
feature/seungin

Conversation

@seung-in-Yoo

@seung-in-Yoo seung-in-Yoo commented Aug 6, 2025

Copy link
Copy Markdown
Member

✔️ 연관 이슈

X

📝 작업 내용

1. 배포 서버에 로그인 관련 API에서 403 에러 발생하였습니다.

  • 해결: refreshtoken DB에 user_id와 userid 칼럼이 중복되어있어서 명시적으로 user_id 칼럼 지정해주고, 배포 DB에 userid 칼럼 삭제하여 해결

2. 배포 서버에 유저 정보 조회 관련 API에서 조회시 403 에러 발생하였습니다. (JPA Lazy Loading + No session 문제)

  • 해결: 관련 필드(장애 유형,이동 보조 수단)에 .size()를 통해 트랜잭션 안에서 호출하여 JPA가 엔티티 리스트를 Lazy → Eager 하도록 설정하여 해결

스크린샷 (선택)

배포 디비 refreshtoken 칼럼 정리

문제해결2

유저 정보 조회 관련 403 에러 해결

화면 캡처 2025-08-06 193224

리뷰 요구 사항 (선택)

X

Summary by CodeRabbit

  • 버그 수정

    • 사용자 정보 조회 시 일부 정보가 올바르게 로딩되지 않던 문제를 해결했습니다.
  • 기타

    • 내부 데이터베이스 컬럼 이름 명시 및 워크플로우 설정 주석이 업데이트되었습니다.

@seung-in-Yoo seung-in-Yoo self-assigned this Aug 6, 2025
@seung-in-Yoo seung-in-Yoo added 🐛 bug fix 버그 수정 🛠️ fix 기능 오류 및 코드 개선이 필요한 곳 수정 labels Aug 6, 2025
@coderabbitai

coderabbitai Bot commented Aug 6, 2025

Copy link
Copy Markdown

Walkthrough

이번 변경 사항은 GitHub Actions 워크플로우 트리거 설정 일부 수정, JPA 엔티티의 컬럼 이름 명시, 그리고 UserInfoService에서 컬렉션의 강제 초기화를 추가하는 등 세 가지 주요 파일에 걸쳐 소규모 업데이트를 포함합니다. 기능적 로직 변경은 없습니다.

Changes

Cohort / File(s) Change Summary
GitHub Actions 워크플로우 트리거
.github/workflows/cd-develop.yml
워크플로우 트리거에 대해 주석 처리된 push 이벤트(특정 브랜치 대상) 추가 및 기존 pull_request 트리거 유지.
JPA 엔티티 컬럼 명시화
src/main/java/com/wayble/server/auth/entity/RefreshToken.java
userId 필드의 JPA 컬럼 어노테이션에 name="user_id"를 명시적으로 추가하여 컬럼명을 지정함.
UserInfoService 컬렉션 초기화
src/main/java/com/wayble/server/user/service/UserInfoService.java
getUserInfo 메서드 내에서 user.getDisabilityType().size()user.getMobilityAid().size() 호출 추가로 컬렉션의 강제 초기화 처리.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant UserInfoService
    participant User

    Client->>UserInfoService: getUserInfo(userId)
    UserInfoService->>User: getDisabilityType()
    User-->>UserInfoService: DisabilityType Collection
    UserInfoService->>User: getMobilityAid()
    User-->>UserInfoService: MobilityAid Collection
    UserInfoService->>UserInfoService: disabilityType.size(), mobilityAid.size() 호출로 강제 초기화
    UserInfoService-->>Client: UserInfo 반환
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • KiSeungMin

Poem

토끼가 깡총, 코드를 봤지
워크플로우 살짝 손보고
엔티티 컬럼 이름도 콕 집어
유저 정보엔 컬렉션도 깨우네
작은 변화, 큰 안정
깡총깡총 리뷰하러 갑니다! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29ab83d and 618212a.

📒 Files selected for processing (3)
  • .github/workflows/cd-develop.yml (1 hunks)
  • src/main/java/com/wayble/server/auth/entity/RefreshToken.java (1 hunks)
  • src/main/java/com/wayble/server/user/service/UserInfoService.java (1 hunks)
🔇 Additional comments (3)
.github/workflows/cd-develop.yml (1)

6-8: 주석 처리된 push 트리거 정리 필요

on: 블록 내부에 서로 다른 형식의 주석(# push: vs #push:)과 불필요한 빈 줄이 섞여 있어 가독성이 떨어집니다. 추후 실제로 트리거를 활성화할 때 혼동을 줄이기 위해 동일한 스타일로 정리하거나, 사용하지 않는 주석은 과감히 제거해주세요.
[ suggest_nitpick ]

src/main/java/com/wayble/server/auth/entity/RefreshToken.java (1)

18-19: 명시적 컬럼 이름 지정 👍

userId 필드에 @Column(name = "user_id")를 추가해 배포 DB와 스키마를 일치시킨 점이 좋습니다. 컬럼 중복 문제를 예방할 수 있습니다.
[ approve_code_changes ]

src/main/java/com/wayble/server/user/service/UserInfoService.java (1)

112-114: Lazy Loading 강제 초기화 방식 개선 권장

size() 호출로 컬렉션을 강제로 초기화하는 방식은 의도가 불분명하고, 추후 개발자가 삭제할 위험이 있습니다.

  1. @EntityGraph 또는 fetch join 쿼리로 한 번에 로딩하거나
  2. Hibernate.initialize(user.getDisabilityType()) 처럼 명시적으로 초기화해 의도를 드러내는 편이 유지보수에 유리합니다.

성능(불필요한 전체 로딩)도 함께 검토해 주세요.
[ suggest_optional_refactor ][ request_verification ]

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/seungin

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@KiSeungMin KiSeungMin merged commit 19801dd into develop Aug 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug fix 버그 수정 🛠️ fix 기능 오류 및 코드 개선이 필요한 곳 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants