Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughFCM 토큰 발급 후 localStorage에 저장을 추가하고, 클라이언트·익스텐션에서 API 페이로드의 시간값을 KST(UTC+9) ISO 유사 포맷으로 일원화했습니다. 또한 package.json에 신규 런타임 의존성을 추가했습니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant M as MainCard (Onboarding)
participant F as FCM Service
participant LS as localStorage
U->>M: 온보딩 진행
M->>F: FCM 토큰 요청
F-->>M: token
M->>LS: setItem("FcmToken", token)
Note right of LS: 토큰 로컬 영속화
sequenceDiagram
autonumber
actor U as User
participant C as CardEditModal (Web)
participant X as MainPop (Ext)
participant H as getKSTISOString
participant API as Backend
rect rgba(230,240,255,0.4)
Note over C,H: 저장/수정 시 현재시각 생성
C->>H: now = getKSTISOString()
X->>H: createdAt/now = getKSTISOString()
end
C->>API: EditArticleRequest { now: KSTString }
X->>API: Save/Update { createdAt|now: KSTString }
API-->>C: 200 OK
API-->>X: 200 OK
Note over API: 시간 포맷 변경(밀리초/Trailing Z 없음)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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 |
|
✅ Storybook chromatic 배포 확인: |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/extension/src/pages/MainPop.tsx (1)
172-177: 공통 유틸리티로 추출하여 코드 중복 제거 권장getKSTISOString() 함수가 CardEditModal.tsx에도 동일하게 구현되어 있습니다. 중복을 제거하고 일관성을 보장하기 위해 공통 유틸리티 함수로 추출하는 것을 권장합니다.
예를 들어,
@shared/utils/datetime.ts또는@utils/datetime.ts에 다음과 같이 추가할 수 있습니다:export function getKSTISOString(): string { const now = new Date(); const kst = new Date(now.getTime() + (9 * 60 * 60000)); // UTC → KST (UTC+9) return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 }그런 다음 MainPop.tsx와 CardEditModal.tsx에서 이 함수를 import하여 사용하세요.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/client/src/pages/onBoarding/components/funnel/MainCard.tsx(1 hunks)apps/client/src/shared/components/cardEditModal/CardEditModal.tsx(2 hunks)apps/extension/src/pages/MainPop.tsx(3 hunks)
🔇 Additional comments (4)
apps/client/src/pages/onBoarding/components/funnel/MainCard.tsx (1)
103-103: FCM 토큰 localStorage 저장 추가 확인FCM 토큰을 localStorage에 저장하는 로직이 적절하게 추가되었습니다. 토큰 영속성 확보를 위한 정상적인 구현입니다.
apps/extension/src/pages/MainPop.tsx (2)
196-196: getKSTISOString() 수정 후 createdAt 필드 동작 확인 필요createdAt 필드에 getKSTISOString()을 사용하고 있습니다. 함수 수정 후 백엔드 API가 이 형식(밀리초 및 'Z' 제거된 ISO 문자열)을 올바르게 처리하는지 확인하세요.
230-230: getKSTISOString() 수정 후 now 필드 동작 확인 필요update 페이로드의 now 필드에 getKSTISOString()을 사용하고 있습니다. 함수 수정 후 백엔드 API가 이 형식을 올바르게 처리하는지 확인하세요.
apps/client/src/shared/components/cardEditModal/CardEditModal.tsx (1)
103-103: getKSTISOString() 수정 후 now 필드 동작 확인 필요EditArticleRequest의 now 필드에 getKSTISOString()을 사용하고 있습니다. 함수 수정 후 백엔드 API가 이 타임스탬프 형식을 올바르게 파싱하고 처리하는지 확인하세요.
| function getKSTISOString() { | ||
| const now = new Date(); | ||
| const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위) | ||
| const kst = new Date(now.getTime() - offset); // UTC → KST 보정 | ||
| return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 | ||
| } |
There was a problem hiding this comment.
KST 변환 로직 오류 수정 필요
MainPop.tsx와 동일한 KST 변환 로직 오류가 있습니다:
- Line 84의
now.getTime() - offset로직이 잘못되었습니다 getTimezoneOffset()은 UTC 서쪽 타임존에 대해 양수 값을 반환합니다- offset을 빼면 UTC로 변환되며, KST(UTC+9)가 아닙니다
- 사용자의 현재 타임존과 무관하게 항상 KST를 생성하려면 9시간을 더해야 합니다
다음 diff를 적용하세요:
function getKSTISOString() {
const now = new Date();
- const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위)
- const kst = new Date(now.getTime() - offset); // UTC → KST 보정
+ const kst = new Date(now.getTime() + (9 * 60 * 60000)); // UTC → KST (UTC+9)
return kst.toISOString().slice(0, 19); // 밀리초, Z 제거
}참고: 이 함수는 MainPop.tsx와 중복되므로, 수정 후 공통 유틸리티로 추출하는 것을 권장합니다(MainPop.tsx 리뷰 참조).
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| function getKSTISOString() { | |
| const now = new Date(); | |
| const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위) | |
| const kst = new Date(now.getTime() - offset); // UTC → KST 보정 | |
| return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 | |
| } | |
| function getKSTISOString() { | |
| const now = new Date(); | |
| const kst = new Date(now.getTime() + (9 * 60 * 60000)); // UTC → KST (UTC+9) | |
| return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 | |
| } |
🤖 Prompt for AI Agents
In apps/client/src/shared/components/cardEditModal/CardEditModal.tsx around
lines 81 to 86, the KST conversion is wrong: currently it subtracts the timezone
offset (now.getTime() - offset) which converts to UTC rather than KST. Replace
the logic to produce KST by adding 9 hours (9 * 60 * 60 * 1000) to a UTC base
(or equivalently add the offset correction plus 9 hours) and return the
resulting ISO string truncated to seconds; after fixing, consider extracting
this function into a shared util (as noted for MainPop.tsx) to avoid
duplication.
| function getKSTISOString() { | ||
| const now = new Date(); | ||
| const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위) | ||
| const kst = new Date(now.getTime() - offset); // UTC → KST 보정 | ||
| return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 | ||
| } |
There was a problem hiding this comment.
KST 변환 로직 오류 수정 필요
getKSTISOString() 함수의 KST 변환 로직이 잘못되었습니다:
- Line 175의
now.getTime() - offset로직이 잘못되었습니다 getTimezoneOffset()은 UTC 서쪽 타임존에 대해 양수 값을 반환합니다 (KST의 경우 +540분)- offset을 빼면 UTC로 변환되며, KST(UTC+9)가 아닙니다
- 사용자의 현재 타임존과 무관하게 항상 KST를 생성하려면 9시간(32400000ms)을 더해야 합니다
다음 diff를 적용하여 올바른 KST 변환을 구현하세요:
function getKSTISOString() {
const now = new Date();
- const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위)
- const kst = new Date(now.getTime() - offset); // UTC → KST 보정
+ const kst = new Date(now.getTime() + (9 * 60 * 60000)); // UTC → KST (UTC+9)
return kst.toISOString().slice(0, 19); // 밀리초, Z 제거
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| function getKSTISOString() { | |
| const now = new Date(); | |
| const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위) | |
| const kst = new Date(now.getTime() - offset); // UTC → KST 보정 | |
| return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 | |
| } | |
| function getKSTISOString() { | |
| const now = new Date(); | |
| const kst = new Date(now.getTime() + (9 * 60 * 60000)); // UTC → KST (UTC+9) | |
| return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 | |
| } |
🤖 Prompt for AI Agents
In apps/extension/src/pages/MainPop.tsx around lines 172 to 177, the KST
conversion currently subtracts the client's timezone offset which produces UTC
instead of KST; replace that logic to always add 9 hours (32400000 ms) to UTC to
produce KST regardless of the user's local timezone. Compute KST by using either
Date.now() or now.getTime() plus 32400000, create a new Date from that value,
and return its ISO string trimmed to seconds as before (slice(0,19)).
This reverts commit ec23586.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: storybook
| "@types/react-router-dom": "^5.3.3", | ||
| "react-router-dom": "^7.8.2" | ||
| "react-router-dom": "^7.8.2", |
There was a problem hiding this comment.
React Router DOM 버전과 타입 정의가 불일치합니다
react-router-dom을 ^7.8.2로 올리면서도 @types/react-router-dom ^5.3.3을 유지하면 v5 전용 선언이 강제로 적용돼 컴파일러가 잘못된 API 시그니처를 참조하거나 중복 선언 충돌이 납니다. v6 이상은 패키지 자체에 타입 정의가 포함되어 있으므로 @types/react-router-dom은 제거해 주세요.
- "@types/react-router-dom": "^5.3.3",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "@types/react-router-dom": "^5.3.3", | |
| "react-router-dom": "^7.8.2" | |
| "react-router-dom": "^7.8.2", | |
| "react-router-dom": "^7.8.2", |
🤖 Prompt for AI Agents
In package.json around lines 47-48, the declared types package
@types/react-router-dom (v5.3.3) conflicts with react-router-dom v7.8.2; remove
the "@types/react-router-dom" dependency from package.json, run your package
manager install (npm/yarn/pnpm) to update node_modules and lockfile, and ensure
no leftover import/type references to @types remain in the project or tsconfig;
if CI includes a cached lockfile, update it so the removed dependency is
reflected.
📌 Related Issues
📄 Tasks
리마인드 세팅할때, 기준이 되는 시점이 UST로 잘못 세팅된 부분 발견..
KST로 변경
⭐ PR Point (To Reviewer)
📷 Screenshot