Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
둘러보기이 변경사항은 채팅 메시지 ID 정규화 및 중복 제거 로직을 개선하는 작업입니다. 다음과 같은 변경사항들이 포함되어 있습니다.
예상 코드 리뷰 난이도🎯 3 (보통) | ⏱️ ~25분 제안 검토자
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3aee3133ba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const messageKey = | ||
| message.id > 0 | ||
| ? `message-${message.id}` | ||
| : `message-${message.senderId}-${message.createdAt}-${message.content}-${index}`; |
There was a problem hiding this comment.
Use a stable key for fallback chat messages
Using index in the fallback React key makes keys shift whenever older items are prepended by infinite scroll, so messages with missing server IDs (the exact target of this fix) are remounted on each page load instead of preserved. In practice this can cause visible flicker/reset of message bubbles and attachment rendering in long threads; the key should be derived from stable message identity only (e.g., fallback id/dedupe key) and not list position.
Useful? React with 👍 / 👎.
배경
채팅방에서 메시지는 보이지만, 뒤로 나갔다가 재진입하면 일부(특히 본인) 메시지 히스토리가 사라지는 현상이 있었습니다.
원인
message.id가 누락되는 경우가 있어 정규화 단계에서id=0으로 변환됨id만으로 중복 제거를 수행하여id=0메시지들이 한 건만 남고 제거됨message.id를 사용해id=0충돌 가능성이 있었음변경 사항
normalizeChatMessage에서id누락 시 메시지 내용 기반의 안정적인 음수 fallback id를 생성하도록 변경id단일값에서 복합 키(id/내용/생성시각/첨부)로 강화검증
pnpm --filter @solid-connect/web exec biome check(수정 파일 대상)pnpm --filter @solid-connect/web typecheck