Skip to content

fix: 참여 완료 모임 재진입 시 결과 화면 표시 - #95

Merged
kokkumong merged 2 commits into
devfrom
feature/92-participant-result-view
Jun 14, 2026
Merged

fix: 참여 완료 모임 재진입 시 결과 화면 표시#95
kokkumong merged 2 commits into
devfrom
feature/92-participant-result-view

Conversation

@kokkumong

Copy link
Copy Markdown
Collaborator

🚀 작업 내용 (What)

  • 참여 완료한 사용자가 모임에 다시 진입하면 일정 입력 화면 대신 일정 조율 현황을 볼 수 있도록 수정했습니다.
  • 일정 조회 API에서 호스트 여부와 참여자 제출 여부를 내려주도록 보강했습니다.
  • 결과 화면은 참여자에게 읽기 전용으로 보여주고, 확정/카톡 알림 같은 호스트 전용 액션은 호스트에게만 노출되도록 분리했습니다.
  • 로그인 상태에서 모임 생성/확정 시 세션을 로드하도록 보강했습니다.

📣 핵심 변경 이유 (Why)

  • 초대받은 모임에 이미 가능 시간을 제출한 사용자가 같은 모임을 눌렀을 때 다시 입력을 요구받는 흐름을 고치기 위해 필요합니다.

📸 스크린샷 (Visuals, 선택)

  • UI 캡처 없음

⚠️ 체크리스트 (Checklist)

  • 브랜치 컨벤션(feature/00-name)을 지켰나요?
  • 커밋 컨벤션(feat:, fix: 등)을 지켰나요?
  • 작업 전에 관련 이슈를 생성하고 연결했나요?
  • 내 코드가 팀의 기존 코드를 망가뜨리지 않았는지 확인했나요?

검증

  • npm run lint
  • npm run build
  • npm run test -- src/lib/schedules/tests/store.test.ts 는 로컬 DATABASE_URL 미설정 및 PostgreSQL Prisma schema 때문에 실행 전 schema 보장 단계에서 실패했습니다.

🔗 관련 이슈 (Issue)

Close #92

@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moim-app Ready Ready Preview, Comment Jun 14, 2026 5:13pm

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kokkumong, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 46 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 78a7f00b-1329-4bb6-b1bc-4d3f537e28af

📥 Commits

Reviewing files that changed from the base of the PR and between 3c6a1ab and 78027dc.

📒 Files selected for processing (4)
  • src/app/api/schedules/[id]/route.ts
  • src/app/schedule/[id]/ScheduleRoomClient.tsx
  • src/lib/schedules/__tests__/store.test.ts
  • src/lib/schedules/store.ts

Walkthrough

store.ts에 토큰 검증 없는 getScheduleResult·getScheduleParticipantForUser 함수를 추가하고, GET/PATCH/POST API 핸들러에 loadSession: true를 활성화하며 응답에 isHost·hasSubmittedAvailability·participantName 필드를 포함하도록 변경. 클라이언트는 해당 응답과 localStorage로 재진입 시 제출 완료 상태를 복원하고, canManage prop으로 호스트 전용 UI를 제어한다.

Changes

스케줄 결과 조회 및 참여자 뷰 복원

Layer / File(s) Summary
store 신규 조회 함수 및 테스트
src/lib/schedules/store.ts, src/lib/schedules/__tests__/store.test.ts
getScheduleResult는 토큰 없이 HostSchedule(hostToken 미포함)을 반환하고, getScheduleParticipantForUser는 scheduleId+userId로 참여자를 조회한다. 각 함수에 대한 단위 테스트 2개가 추가됐다.
GET/PATCH/POST 라우트 세션 활성화 및 응답 확장
src/app/api/schedules/[id]/route.ts, src/app/api/schedules/route.ts
GET 핸들러에 loadSession: true 추가, 생성자·호스트토큰 분기에 isHost: true 포함, 쿠키 무효 및 기본 경로에서 getScheduleResult+getScheduleParticipantForUser 기반으로 hasSubmittedAvailability·participantName 응답. PATCH·POST도 loadSession: true 추가.
클라이언트 재진입 복원 및 canManage 게이팅
src/app/schedule/[id]/ScheduleRoomClient.tsx
serverSaysHost·hasSubmittedAvailability 상태 추가, 초기 fetch에서 API 응답과 localStorage로 제출 완료 상태 복원, shouldShowResultView로 결과 뷰 전환. HostView/HostResultPanelcanManage 전달해 확정 버튼·카톡 알림 버튼을 호스트 전용으로 제한.

추정 코드 리뷰 노력

🎯 4 (Complex) | ⏱️ ~50 minutes

연관 PR

  • Siul49/moim#73: ScheduleRoomClient.tsxisHostView 분기 로직을 공유하며 이번 PR의 serverSaysHost·shouldShowResultView 변경과 직접 충돌 가능성이 있음.
  • Siul49/moim#78: ScheduleParticipant.userId 저장 로직을 도입해 이번 PR의 getScheduleParticipantForUser 조회를 실질적으로 가능하게 만드는 선행 PR.
  • Siul49/moim#41: 동일한 스케줄 GET 라우트의 호스트 토큰 쿠키 처리·조회 경로를 수정해 이번 PR과 같은 코드 영역을 다룸.

제안 레이블

bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 명확하게 변경 내용을 설명하며, 'fix:' 접두사 규칙을 준수하고 PR 객체와 일치한다.
Description check ✅ Passed 템플릿의 모든 필수 섹션(작업 내용, 핵심 변경 이유, 체크리스트, 관련 이슈)을 포함하고 상세하게 작성되어 있다.
Linked Issues check ✅ Passed 코드 변경사항이 #92의 모든 요구사항을 충족한다: 참여자 재진입 시 결과 화면 표시, API에서 호스트/제출 상태 반환, 호스트 전용 액션 분리.
Out of Scope Changes check ✅ Passed 모든 변경사항이 #92 범위 내에 있다. 세션 로딩 추가는 호스트 확정 기능 지원을 위해 필요한 범위 내 변경이다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/92-participant-result-view

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 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/app/api/schedules/`[id]/route.ts:
- Around line 68-89: The logic for fetching participant and schedule data is
duplicated across multiple locations in the route handler. Extract this common
pattern into a helper function that encapsulates the calls to
getScheduleParticipantForUser and getScheduleResult based on the session and
schedule ID. This helper should handle the conditional participant lookup based
on whether a session exists, returning both the participant and schedule data
together. Replace all duplicate occurrences of this pattern with calls to the
new helper function to improve maintainability and prevent inconsistencies
during future modifications.

In `@src/app/schedule/`[id]/ScheduleRoomClient.tsx:
- Around line 258-268: When the server response indicates
hasSubmittedAvailability is false, the localStorage cache (savedSubmittedName)
should be invalidated to prevent showing a result view for a submission that no
longer exists on the server. Add logic to clear or remove the saved submitted
name from localStorage when hasSubmittedAvailability is false, ensuring that the
client state stays synchronized with the server state and the localStorage cache
is only used as a temporary hint when the server confirms the submission
actually exists. This prevents the edge case where users see results but have no
way to resubmit when their data has been deleted on the server.

In `@src/lib/schedules/__tests__/store.test.ts`:
- Around line 121-148: The test for "finds a submitted participant by schedule
and user id" is missing an edge case for empty userId. Add a test assertion that
verifies the behavior of getScheduleParticipantForUser when called with an empty
string as the userId parameter (in addition to the existing "other-user" test),
ensuring the function properly handles this edge case and returns the expected
result (likely null).

In `@src/lib/schedules/store.ts`:
- Around line 147-156: The getScheduleParticipantForUser function lacks
validation for empty userId values. When userId is passed as an empty string,
the function will execute the database query with that empty value instead of
returning null early. Add a guard clause at the start of the function to check
if userId is empty or falsy, and return null immediately if so, providing
defensive validation at the store level before any database operations occur.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e4ae2d84-1a8e-4f69-a920-8fdd9041c4ee

📥 Commits

Reviewing files that changed from the base of the PR and between 201fe3f and 3c6a1ab.

📒 Files selected for processing (5)
  • src/app/api/schedules/[id]/route.ts
  • src/app/api/schedules/route.ts
  • src/app/schedule/[id]/ScheduleRoomClient.tsx
  • src/lib/schedules/__tests__/store.test.ts
  • src/lib/schedules/store.ts

Comment thread src/app/api/schedules/[id]/route.ts
Comment thread src/app/schedule/[id]/ScheduleRoomClient.tsx
Comment thread src/lib/schedules/__tests__/store.test.ts
Comment thread src/lib/schedules/store.ts
@kokkumong
kokkumong merged commit b60198e into dev Jun 14, 2026
5 checks passed
@kokkumong
kokkumong deleted the feature/92-participant-result-view branch June 14, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 참여 완료한 모임 재진입 시 일정 입력 화면으로 돌아가는 문제

1 participant