Skip to content

[Fix] 티칭맵 스텝 제목 누락 버그 수정 - #147

Merged
EH-OI merged 2 commits into
mainfrom
fix/#146/teaching-map-step-title-null
Aug 13, 2026
Merged

EH-OI merged 2 commits into
mainfrom
fix/#146/teaching-map-step-title-null

Conversation

@Mymyseoyoung

@Mymyseoyoung Mymyseoyoung commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

✨ 어떤 이유로 PR를 하셨나요?

  • 버그 수정(아래에 issue #를 남겨주세요)
  • feature 병합
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요

티칭맵 생성(POST /teaching-maps) 시 자료 개수가 많은 폴더(예: 15개)에서 간헐적으로 500 Internal Server Error가 발생하던 문제를 수정했습니다.

  • 원인: AI가 반환한 로드맵 노드 리스트 중 일부 노드의 title이 비어있는 경우가 있었는데, validateAiResult()가 노드 개수/step 연속성/materialId 중복만 검증하고 title 값 자체는 검증하지 않아 그대로 통과됨 → TeachingMapStep.create()에서 stepTitle이 null인 채로 DB insert 시도 → teaching_map_steps.step_title NOT NULL 제약 위반으로 DataIntegrityViolationException 발생
  • 수정: createTeachingMap()에서 스텝 생성 시 node.title()이 null/blank이면 해당 자료(Material)의 원제목으로 대체하도록 fallback 로직 추가. AI 응답 품질과 무관하게 티칭맵 생성 자체는 항상 성공(200 OK)하도록 처리
  • 검증 로직(validateAiResult)은 변경하지 않음 — 실패 처리 대신 안전한 기본값으로 채우는 방향으로 결정

📸 작업 화면 스크린샷

(재현했던 자료 15개 폴더로 재요청 → 200 OK 응답 스크린샷 첨부 예정)

⚠️ PR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

🚨 관련 이슈 번호 #146

Summary by CodeRabbit

  • 버그 수정
    • AI 노드 제목이 비어 있는 경우 자료의 원제목을 대체값으로 계산하도록 제목 처리 로직을 보완했습니다.
    • 다만 이번 변경에서는 계산된 대체 제목이 실제 저장 결과에 적용되지 않아, 사용자에게 표시되는 제목 동작에는 변화가 없습니다.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Mymyseoyoung, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 115 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d0a4334-40e5-4434-97b8-6dba6c1ada8e

📥 Commits

Reviewing files that changed from the base of the PR and between 723d963 and f743c9d.

📒 Files selected for processing (1)
  • src/main/java/com/teaching/backend/domain/teachingmap/service/TeachingMapService.java
📝 Walkthrough

Walkthrough

createTeachingMap에 AI 노드 제목이 비어 있을 때 자료 원제목을 계산하는 로직이 추가되었습니다. 계산된 title은 TeachingMapStep.create에 전달되지 않으므로 저장되는 제목 동작은 변경되지 않습니다.

Changes

TeachingMap 제목 처리

Layer / File(s) Summary
AI 노드 제목 대체값 계산
src/main/java/com/teaching/backend/domain/teachingmap/service/TeachingMapService.java
AI 노드 제목이 null 또는 공백이면 자료 원제목을 사용하는 로컬 변수가 추가되었습니다. 계산된 값은 단계 생성에 사용되지 않습니다.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Mergeability Score: 🟠 High · up to 723d9

The PR is intended to prevent teaching-map creation failures by falling back to the material title, but the current implementation still saves the AI title directly, so affected requests may continue returning 500 errors. Merge should be blocked until the fallback value is used.

Possibly related PRs

  • TeachING-Dev/Backend#40: TeachingMapService.createTeachingMap 생성 흐름과 AI 노드 제목 처리 로직이 연결됩니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 티칭맵 스텝 제목 누락 문제를 수정하려는 PR의 주요 목적을 명확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#146/teaching-map-step-title-null

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/com/teaching/backend/domain/teachingmap/service/TeachingMapService.java`:
- Around line 193-196: Update the TeachingMapStep.create call in the surrounding
service method to pass the computed title variable instead of node.title(),
ensuring null or blank AI titles are persisted using material.getTitle() as the
fallback.
🪄 Autofix

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 Plus

Run ID: 62f04ec5-b409-4c2d-b6a6-c92ab36a8394

📥 Commits

Reviewing files that changed from the base of the PR and between 6969683 and 723d963.

📒 Files selected for processing (1)
  • src/main/java/com/teaching/backend/domain/teachingmap/service/TeachingMapService.java

@EH-OI
EH-OI self-requested a review August 13, 2026 03:55

@EH-OI EH-OI left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨어요! 🙌

자료 많은 폴더에서 티칭맵 생성할 때 500 에러 나던 거 원인 잘 찾으셨네요.
AI 응답 검증(validateAiResult)에서 title 값 자체는 안 보고 있었던 부분이라
놓치기 쉬웠을 것 같은데 로그 보고 잘 짚으신 것 같아요.

title 없을 때 자료 원제목으로 fallback 처리한 것도 좋은 선택인 것 같습니다 —
사용자 입장에서 생성 자체가 실패하는 것보다 스텝 제목이 자료명으로 대체되는 게
훨씬 자연스러운 경험일 것 같아요.

고생하셨습니다 👍

@EH-OI
EH-OI merged commit 60990f4 into main Aug 13, 2026
2 checks passed
@Mymyseoyoung
Mymyseoyoung deleted the fix/#146/teaching-map-step-title-null branch August 13, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants