Skip to content

요약 다시 시도 api 연결#440

Merged
Bangdayeon merged 1 commit intomainfrom
feat/#436-summary-retry-api
Apr 1, 2026
Merged

요약 다시 시도 api 연결#440
Bangdayeon merged 1 commit intomainfrom
feat/#436-summary-retry-api

Conversation

@Bangdayeon
Copy link
Copy Markdown
Member

@Bangdayeon Bangdayeon commented Mar 22, 2026

관련 이슈

PR 설명

  • 추가된 엔드포인트로 api 코드 및 훅 작성 후, 버튼에 연결

@Bangdayeon Bangdayeon self-assigned this Mar 22, 2026
@Bangdayeon Bangdayeon added the wontfix This will not be worked on label Mar 22, 2026
@Bangdayeon Bangdayeon linked an issue Mar 22, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 22, 2026

Warning

Rate limit exceeded

@Bangdayeon has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 56 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 56 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2a3196f9-becf-4d99-8c27-044374ff3dc8

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8b0c0 and 3dfd89c.

📒 Files selected for processing (6)
  • src/apis/summary.ts
  • src/app/api/links/[id]/retry-summary/route.ts
  • src/components/wrappers/LinkCardDetailPanel/LinkCardDetailPanel.tsx
  • src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx
  • src/hooks/useRetrySummary.ts
  • src/stories/LinkCardDetailPanel.stories.tsx

Walkthrough

LinkCardDetailPanel에서 onRetrySummary prop이 제거되어 더 이상 상위 컴포넌트에서 요약 재시도를 전달하지 않습니다. SummarySection은 이제 onRetrySummary prop을 받지 않고 내부에서 useRetrySummary(linkId) 훅을 사용해 retrySummaryMutateisLoading을 얻어 자체 onRetrySummary 핸들러로 재시도 요청을 트리거하며, “다시 시도” 버튼은 해당 내부 핸들러와 로딩 상태를 사용합니다. 서버측에는 /api/links/[id]/retry-summary POST 엔드포인트와 클라이언트 API retrySummary 함수가 추가되었습니다.

Possibly related PRs

  • LinkCardDetailPanel 컴포넌트 구현 #275: 동일 파일 LinkCardDetailPanel.tsx를 변경한 PR로, 이번 PR에서 제거된 onRetrySummary prop의 도입 또는 초기 구현과 직접 연관됩니다.
  • 상세 패널 메모 불러오도록 수정 #400: SummarySection과 요약 처리 로직을 수정한 PR로, 이번 변경사항의 내부 재시도 구현과 코드 수준에서 강하게 연결됩니다.
  • 요약 재생성 api 함수 수정 #437: 재요약(resummary) 흐름과 관련된 API 엔드포인트 및 클라이언트 호출을 변경한 PR로, 새로 추가된 /retry-summary 엔드포인트 및 retrySummary 함수와 밀접한 관련이 있습니다.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목 '요약 다시 시도 api 연결'은 PR의 주요 변경사항인 요약 재시도 기능의 API 연결을 명확하게 요약합니다.
Linked Issues check ✅ Passed 코드 변경사항이 이슈 #436의 요구사항인 '요약 재시도 버튼을 백엔드 API에 연결'을 완벽하게 구현합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 요약 재시도 API 연결이라는 범위 내에 있으며, 무관한 변경은 없습니다.
Description check ✅ Passed PR 설명이 기본 요구사항을 충족하고 있습니다. 관련 이슈 참조와 간단한 변경 내용이 포함되어 있습니다.

✏️ 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 feat/#436-summary-retry-api

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.

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx`:
- Around line 36-38: The onRetrySummary handler currently only logs to console
and must call the backend retry API; replace the console.log in onRetrySummary
with a useMutation-based call (e.g., create a retrySummary mutation via
useMutation or a provided useRetrySummary hook) and invoke its mutate/trigger
method inside onRetrySummary, handling loading, success and error states (update
local state or refetch summary on success and show an error toast or set error
state on failure); ensure you reference and import the mutation hook and use the
exact handler name onRetrySummary and the mutation identifier (e.g.,
retrySummaryMutation or useRetrySummary) so the "다시 시도" button actually performs
the backend retry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7ed45d93-8f61-4c1c-b284-d4c13e044180

📥 Commits

Reviewing files that changed from the base of the PR and between b6eff47 and 926e18d.

📒 Files selected for processing (2)
  • src/components/wrappers/LinkCardDetailPanel/LinkCardDetailPanel.tsx
  • src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx
💤 Files with no reviewable changes (1)
  • src/components/wrappers/LinkCardDetailPanel/LinkCardDetailPanel.tsx

@Bangdayeon Bangdayeon changed the title [WIP] Feat: summary retry api (#436) 요약 다시 시도 api 연결 Mar 31, 2026
@Bangdayeon Bangdayeon force-pushed the feat/#436-summary-retry-api branch from 926e18d to 6e8b0c0 Compare March 31, 2026 18:04
Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
src/apis/summary.ts (1)

14-16: 응답 검증 로직은 공통 헬퍼로 추출해도 좋겠습니다.

Line 14-16 패턴이 같은 파일 내 여러 API 함수에서 반복됩니다. 공통화하면 에러 메시지/검증 기준 변경 시 누락 가능성을 줄일 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/apis/summary.ts` around lines 14 - 16, Extract the repeated response
validation (the body?.data && body.success check and throw new
Error(body?.message ?? 'Invalid response structure')) into a shared helper such
as validateApiResponse(response) and replace the in-place checks in all API
functions in this file with calls to that helper; ensure the helper accepts the
raw body, performs the same conditional (checking body?.data and body.success),
throws the same Error message when invalid, and export/import it where needed so
all API handlers use a single canonical validation point.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/app/api/links/`[id]/retry-summary/route.ts:
- Around line 10-11: The current id check (using isNaN) allows negative and
non-integer values like -1 or 1.5; update the validation in the request handler
so id is parsed to a number and explicitly required to be a positive integer
(e.g., use Number(...) or parseInt then assert Number.isInteger(id) && id > 0)
before proceeding; change the early return in the route (the block that
currently returns NextResponse.json({ success: false, message: 'Invalid id.' },
{ status: 400 })) to trigger when the id fails this positive-integer test and
reference the same id variable used in the handler.

---

Nitpick comments:
In `@src/apis/summary.ts`:
- Around line 14-16: Extract the repeated response validation (the body?.data &&
body.success check and throw new Error(body?.message ?? 'Invalid response
structure')) into a shared helper such as validateApiResponse(response) and
replace the in-place checks in all API functions in this file with calls to that
helper; ensure the helper accepts the raw body, performs the same conditional
(checking body?.data and body.success), throws the same Error message when
invalid, and export/import it where needed so all API handlers use a single
canonical validation point.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2ac2fb38-91e3-4b05-a3cf-e508ab5a3de5

📥 Commits

Reviewing files that changed from the base of the PR and between 926e18d and 6e8b0c0.

📒 Files selected for processing (5)
  • src/apis/summary.ts
  • src/app/api/links/[id]/retry-summary/route.ts
  • src/components/wrappers/LinkCardDetailPanel/LinkCardDetailPanel.tsx
  • src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx
  • src/hooks/useRetrySummary.ts
💤 Files with no reviewable changes (1)
  • src/components/wrappers/LinkCardDetailPanel/LinkCardDetailPanel.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx

Comment thread src/app/api/links/[id]/retry-summary/route.ts Outdated
@Bangdayeon Bangdayeon force-pushed the feat/#436-summary-retry-api branch from 6e8b0c0 to c1b732c Compare March 31, 2026 18:10
@Bangdayeon Bangdayeon removed the wontfix This will not be worked on label Mar 31, 2026
@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@Bangdayeon Bangdayeon merged commit c262cad into main Apr 1, 2026
5 checks passed
@Bangdayeon Bangdayeon deleted the feat/#436-summary-retry-api branch April 1, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

요약 생성 재시도 api 연결

2 participants