fix: ai_room 이름 변경, 초대 링크 버그 수정, 판결받기 버튼 개선 - #92
Merged
Conversation
room_mode의 ai_chat을 ai_room으로 변경한다. AI 대화 기능이 없음에도 chat이라는 이름이 오해를 유발해 수정한다. dispute_status에 a_submitted를 추가한다. 단독/1:1 판결 흐름 모두 role_a 진술 제출 시 중간 상태를 명시적으로 표현한다. - 단독: draft → a_submitted → judging → judged - 1:1: ... → opponent_joined → a_submitted → both_submitted → judging → judged Co-Authored-By: Claude <noreply@anthropic.com>
room_mode 변경(ai_chat → ai_room)에 따라 관련 API 코드를 일괄 수정한다. 초대 링크 발급 시 AI_ROOM과 INVITE_READY 모두 허용한다. 기존에는 AI_CHAT 상태에서만 발급 가능해 같은 버튼을 두 번 누르면 실패하는 문제가 있었다. 재발급 시 기존 링크는 무효화된다. 초대 링크 발급 시 dispute가 DRAFT 상태면 WAITING_OPPONENT로 업데이트한다. Co-Authored-By: Claude <noreply@anthropic.com>
카카오톡으로 링크를 전달한 뒤 상대방이 며칠 후 확인하는 케이스를 고려해 만료 기간을 7일로 늘린다. Co-Authored-By: Claude <noreply@anthropic.com>
role_a 진술 제출 시 dispute 상태를 WAITING_OPPONENT에서 A_SUBMITTED로 변경한다. role_b는 A_SUBMITTED 이후에만 진술 제출이 가능하도록 조건을 강화한다. 단독 판결 트리거 조건을 WAITING_OPPONENT에서 A_SUBMITTED로 변경한다. 진행중 사건 목록 필터에 A_SUBMITTED 상태를 추가한다. IMMUTABLE_DISPUTE_STATUSES에 A_SUBMITTED를 추가한다. Co-Authored-By: Claude <noreply@anthropic.com>
진술 내용이 존재하면 단독 판결받기 버튼을 활성화한다. 기존에는 a_submitted 상태를 확인했으나 진술 작성 완료와 동시에 제출이 이루어지므로 content 존재 여부로 조건을 변경한다. StatusBadge에 a_submitted 상태를 추가한다. Co-Authored-By: Claude <noreply@anthropic.com>
room_mode: ai_chat → ai_room 반영 dispute_status: a_submitted 추가 및 단독/1:1 흐름 분리 명시 서비스 흐름에서 AI 대화 단계 제거 (AI 대화 페이지 미구현) 방 정책 섹션 현행화 Co-Authored-By: Claude <noreply@anthropic.com>
waiting_opponent이 이미 'A 진술 제출 완료' 의미를 포함하므로 별도의 a_submitted 상태가 불필요하다고 판단해 제거. - schema, migration, types, constants에서 A_SUBMITTED 제거 - ROLE_A 진술 제출 후 상태: A_SUBMITTED → WAITING_OPPONENT 복원 - ROLE_B 제출 guard: OPPONENT_JOINED 기준으로 복원 (BOTH_SUBMITTED 허용으로 재시도 멱등성 보장) - 단독 판결 guard: WAITING_OPPONENT 기준으로 복원 - invite/route.ts: existingDispute 조회를 트랜잭션 내부로 이동 (TOCTOU 방지) - CLAUDE.md 상태 전이 업데이트 Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ai_chat → open → ai_room 두 단계 마이그레이션을 ai_chat → ai_room 단일 파일로 통합. Co-Authored-By: Claude <noreply@anthropic.com>
lyla-bae
commented
Jun 20, 2026
| creatorUserId String @map("creator_user_id") @db.Uuid | ||
| categoryGroup CategoryGroup @map("category_group") | ||
| roomMode RoomMode @default(AI_CHAT) @map("room_mode") | ||
| roomMode RoomMode @default(AI_ROOM) @map("room_mode") |
Member
Author
There was a problem hiding this comment.
CHAT보다 ROOM이 더 맞는 네이밍같아서 바꾸어보았습니다 참고부탁드려요
@evenif99 @juahcheon
lyla-bae
commented
Jun 20, 2026
| import { createHmac, randomUUID } from 'crypto' | ||
|
|
||
| const INVITE_EXPIRES_HOURS = 72 | ||
| const INVITE_EXPIRES_HOURS = 168 // 7일 |
Member
Author
There was a problem hiding this comment.
초대링크 유효기간 3일 -> 7일로 늘렸는데 다른의견있으시면 코멘트 부탁드림니다
Member
Author
|
확인해보시고 이상없으시면 merge 부탁드립니다 |
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.
변경 배경
프론트 연동 테스트 중 발견한 초대 링크 버그 수정 및 관련 상태/이름 정리.
변경 사항
1.
ai_chat→ai_room이름 변경AI 채팅 기능이 없는데
ai_chat이라는 이름이 실제 흐름과 맞지 않아ai_room으로 수정.모든 방은 AI가 판결하는 방이라는 의미를 반영.
2. 초대 링크 재발급 버그 수정
두 번째 초대 링크 복사 시 422 에러 발생하던 버그 수정.
room.roomMode !== 'AI_CHAT'조건으로INVITE_READY상태에서 재발급 불가AI_ROOM || INVITE_READY둘 다 허용3. 초대 링크 만료 기간 변경
72시간 → 7일. 카카오톡으로 전달 후 며칠 뒤 열 수 있는 상황 고려.
4. 초대 트랜잭션 TOCTOU 수정
invite 발급 시 dispute 상태 조회를 트랜잭션 내부로 이동.
트랜잭션 밖 스테일 값으로 상태를 덮어쓸 수 있던 위험 제거.
5. 판결받기 버튼 활성화 조건 수정
status === waiting_opponent || both_submitted기준 → 1인 사용자 버튼 비활성화6. ROLE_B 진술 제출 멱등성 보장
ROLE_B 첫 제출 성공 후 네트워크 재시도 시 422 반환하던 문제.
BOTH_SUBMITTED상태에서도 ROLE_B 접근 허용하여submittedAt멱등성 체크까지 도달하도록 수정.DB 마이그레이션
영향 범위
ai_room이름 변경, 초대 재발급 조건 변경disputes/[id]/page.tsx): 판결받기 버튼 활성화 조건🤖 Generated with Claude Code