Skip to content

Fix: 리마인드 비교기준 now 시간 UST->KST#167

Merged
jllee000 merged 5 commits intodevelopfrom
fix/#166/#remind-KST-setting
Oct 1, 2025
Merged

Fix: 리마인드 비교기준 now 시간 UST->KST#167
jllee000 merged 5 commits intodevelopfrom
fix/#166/#remind-KST-setting

Conversation

@jllee000
Copy link
Collaborator

@jllee000 jllee000 commented Sep 30, 2025

📌 Related Issues

관련된 Issue를 태그해주세요. (e.g. - close #25)

📄 Tasks

리마인드 세팅할때, 기준이 되는 시점이 UST로 잘못 세팅된 부분 발견..
KST로 변경

⭐ PR Point (To Reviewer)

  • vite, @swc/core, @tanstack/react-query-devtools 관련 peer dependency warning 제거
  • 설치 및 빌드 시 불필요한 경고 메시지 제거

📷 Screenshot

@vercel
Copy link

vercel bot commented Sep 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
pinback-client-client Ready Ready Preview Comment Oct 1, 2025 8:09am
pinback-client-landing Ready Ready Preview Comment Oct 1, 2025 8:09am

@coderabbitai
Copy link

coderabbitai bot commented Sep 30, 2025

Walkthrough

FCM 토큰 발급 후 localStorage에 저장을 추가하고, 클라이언트·익스텐션에서 API 페이로드의 시간값을 KST(UTC+9) ISO 유사 포맷으로 일원화했습니다. 또한 package.json에 신규 런타임 의존성을 추가했습니다.

Changes

Cohort / File(s) Summary
Onboarding FCM 토큰 영속화
apps/client/src/pages/onBoarding/components/funnel/MainCard.tsx
FCM 토큰 획득 시 state 설정 외에 localStorageFcmToken 키로 추가 저장
카드 편집 시간 포맷(KST) 적용 - Web
apps/client/src/shared/components/cardEditModal/CardEditModal.tsx
KST 기준 ISO 유사 문자열 생성 헬퍼 getKSTISOString 도입, 요청 페이로드의 now 값을 toISOString()에서 KST 문자열로 교체
저장/수정 시간 포맷(KST) 적용 - Extension
apps/extension/src/pages/MainPop.tsx
getKSTISOString 도입, 추가/저장 경로의 createdAt, 업데이트 경로의 now 값을 KST 문자열로 교체
의존성 추가
package.json
swc-helpers, tanstack-react-query, yaml 추가

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: 토큰 로컬 영속화
Loading
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 없음)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

frontend

Suggested reviewers

  • jjangminii
  • constantly-dev

Poem

야호, 시계가 아홉을 가리키네 ⏰
KST에 맞춰 깡총 깡총 뛰어가고,
토큰은 금고(localStorage)에 쏙—안전하게!
웹과 익스텐션, 시간발 맞추니
바람은 산뜻, 코드도 산뜻 (\’ω’\)
오늘도 토끼는 머리를 까딱—저장 완료!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning PR은 #166 이슈의 KST 기반 날짜 처리 수정 요구사항을 반영했으나 디자인 시스템의 Progress 컴포넌트 구현을 요구하는 #25 이슈는 전혀 다루지 않고 있어 연결된 이슈 중 일부를 충족하지 않습니다. #25 이슈의 Progress 컴포넌트 구현 요구사항을 추가하거나 해당 이슈 연결을 제거하여 링크된 이슈와 실제 변경사항을 일치시켜 주세요.
Out of Scope Changes Check ⚠️ Warning MainCard.tsx의 FCM 토큰을 localStorage에 저장하도록 한 변경과 package.json에 swc-helpers, tanstack-react-query, yaml 의존성을 추가한 부분은 날짜 포맷 수정(#166) 또는 Progress 컴포넌트 구현(#25)과 직접적인 관련이 없습니다. FCM 토큰 저장 로직과 새로운 의존성 추가는 별도 PR로 분리하거나 제거하여 이 PR이 의도한 범위에만 집중하도록 정리해 주세요.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed 제목이 주요 변경사항인 now 시간 포맷을 UST(UTC로 추정)에서 KST로 변경하는 의도를 명확히 반영하고 있어 변경 내용을 잘 요약하고 있습니다. 간결하고 명확하며 불필요한 용어가 포함되어 있지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed PR 설명은 템플릿의 필수 섹션(관련 이슈, 작업 내용, PR 포인트)을 모두 포함하고 있으며, 각 항목이 구체적으로 작성되어 전반적으로 요구사항을 충족합니다. 비어 있는 스크린샷 섹션은 선택 사항이므로 설명의 완전성에 큰 영향을 주지 않습니다.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#166/#remind-KST-setting

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.

@github-actions github-actions bot added the fix 버그 수정하라 러브버그 label Sep 30, 2025
@jllee000 jllee000 changed the title Fix/#166/#remind kst setting Fix: 리마인드 비교기준 now 시간 UST->KST Sep 30, 2025
@github-actions
Copy link

github-actions bot commented Sep 30, 2025

✅ Storybook chromatic 배포 확인:
🐿️ storybook

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1f001d0 and 73b041d.

📒 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가 이 타임스탬프 형식을 올바르게 파싱하고 처리하는지 확인하세요.

Comment on lines +81 to +86
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 제거
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
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.

Comment on lines +172 to +177
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 제거
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
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)).

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec23586 and 7d2efed.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is 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

Comment on lines 47 to +48
"@types/react-router-dom": "^5.3.3",
"react-router-dom": "^7.8.2"
"react-router-dom": "^7.8.2",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
"@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.

@jllee000 jllee000 merged commit 78cd389 into develop Oct 1, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 버그 수정하라 러브버그

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 익스텐션 오늘 날짜 기준 수정

1 participant