[fix] /missions/current 신규 유저 500(USER_LEVEL_NOT_FOUND) 해결#269
Merged
Conversation
회고 전(레벨 행 없는) 유저가 /api/v1/missions/current 호출 시 UserLevelNotFound로 500 나던 문제 수정. ensureInitialized로 UserLevel(Lv.1)+ Lv.1 미션을 자가 생성 후 조회하도록 변경(소급/마이그레이션 불필요). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
회고를 한 번도 안 한 유저(신규 온보딩, v1.2.0 배포 후 기존 유저 전원)가
GET /api/v1/missions/current호출 시UserLevel행이 없어USER_LEVEL_NOT_FOUND가 500으로 떨어졌습니다. (레벨/미션 데이터가 첫 회고 저장 때만 lazy 생성되기 때문)수정
UserMissionRegister.ensureInitialized(userId)추가: 레벨 행이 없으면UserLevel(Lv.1)+ Lv.1 미션을 생성(자가 치유, 마이그레이션 불필요)MissionApi.getCurrentMission이 조회 전에ensureInitialized호출 → 신규 유저도 Lv.1 미션 카드를 정상 반환🤖 Generated with Claude Code