Repository navigation
[DONE] 서버가 HTML 오류 쪽을 돌려줘도 커뮤니티 글 칸이 「Network error.」 대신 서버가 몇 번으로 답했는지 말한다 - #292
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhhnwQJLYXfjnFh8gg7q4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhhnwQJLYXfjnFh8gg7q4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhhnwQJLYXfjnFh8gg7q4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhhnwQJLYXfjnFh8gg7q4
patternflow-bot
marked this pull request as ready for review
October 26, 2026 19:53
This was referenced Oct 26, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 27, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 27, 2026
Patternflow-lab#268 Patternflow-lab#271 Patternflow-lab#275 Patternflow-lab#276 Patternflow-lab#277 Patternflow-lab#279 Patternflow-lab#280 Patternflow-lab#281 Patternflow-lab#283 Patternflow-lab#284 Patternflow-lab#285 Patternflow-lab#286 Patternflow-lab#287 Patternflow-lab#288 Patternflow-lab#289 Patternflow-lab#290 Patternflow-lab#291 Patternflow-lab#292 Patternflow-lab#293 Patternflow-lab#294 Patternflow-lab#295 Patternflow-lab#296 Patternflow-lab#297 Patternflow-lab#298 Patternflow-lab#299 Patternflow-lab#300 Patternflow-lab#301 Patternflow-lab#302 Patternflow-lab#303
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lsh / https://claude.ai/code/session_01DvhhnwQJLYXfjnFh8gg7q4
커뮤니티의 댓글 칸과 창 다섯(Edit details, Report, 펌웨어 헤더, 퍼포먼스, 덱 공유)은 서버가 HTML 오류 쪽으로 답하면 「Network error.」 라고만 했어요. 서버는 답을 했는데요. 머지하면 「Comment failed (HTTP 502).」 처럼 몇 번으로 답했는지 말하고, 서버가 제 글을 보냈으면 그 글을 그대로 보여요.
좋아지는 것: 서버가 HTML 로 거절해도 몇 번인지 보인다 — 끊긴 것과 거절을 가린다
readApiError도우미와 시험한 일
lib/community/apiBase.ts에readApiError(response, fallback)를 더했어요. 몸이{ error }가 든 JSON 이면 그 글을 돌려주고, HTML 이거나 비었거나error가 글이 아니면「fallback」 (HTTP 502).를 돌려줘요. JSON 읽기가 실패해도 던지지 않아서,catch의 「Network error.」 는 fetch 가 아무 데도 닿지 못한 때만 나와요.쓰는 곳은 여덟이에요.
CommentSection.tsx의 올리기, 고치기, 지우기와EditDetailsModal.tsx,ReportModal.tsx,AddHeaderModal.tsx,AddPerformanceModal.tsx,ShareDeckModal.tsx예요. 여섯 곳은ok를 보기 전에 몸을 JSON 으로 읽었는데, 이제!response.ok를 먼저 보고 그때만 도우미로 읽어요. 성공한 답의 몸은 아무도 쓰지 않아서(ShareDeckModal의id만 빼고) 읽지 않아요.AddHeaderModal의hasCpp는 읽는 곳이 없었어요. 글은 PublishModal 이 이미 쓰는 꼴(「Publishing failed (HTTP 502).」)을 따랐어요.증거
Pi 와 같은
NEXT_PUBLIC_COMMUNITY_URL,NEXT_PUBLIC_BUILD_ENABLED로 이 브랜치와 dev 의 컴포넌트 여섯을 따로 빌드했어요. 스크래치 DB 에 ada 와 공개 패턴 하나를 HTTP 로 넣고, ada 로 그 패턴 쪽을 열었어요. Playwrightpage.route가 댓글 POST 에는 nginx 의 502 쪽을, Edit details 의 PATCH 에는 413 쪽을text/html로 돌려줬어요. 나머지 경로는 진짜 서버가 답했어요.새 시험 셋을 dev 의 컴포넌트로 돌렸을 때(도우미 시험은 dev 에 도우미가 없어서 빼고):
dev 에서 지난 것은 서버가 JSON 으로 제 글을 보낸 때와 fetch 가 끊긴 때, 성공한 올리기예요. 이 브랜치에서도 그대로 지나요.
다섯 검사(
web/에서):links-absolute와roadmap은 이 컨테이너에gh로 원래 레포를 읽을 길이 없어서skipped예요. PR 의drift.yml이 다시 돌려요.실행법
# web/ 에서 npx vitest run src/lib/community/apiBase.test.ts src/components/community/CommentSection.test.tsx src/components/community/formErrors.test.tsx화면으로 보려면 커뮤니티를 띄우고 패턴 쪽에서 댓글을 올리기 전에 개발자 도구로
POST /api/community/patterns/<id>/comments를 막아요. 끊긴 때는 그대로 「Network error.」 예요.가정
LikeButton.tsx:52는 고치지 않았어요. 그 줄은 성공한 답을 읽는 곳이고, 실패한 답(:47:51)은 몸을 읽지 않고 말없이 되돌려요. 좋아요 단추엔 글을 보일 자리가 없어서 도우미가 돌려줄 글을 받을 곳이 없어요. 까닭을 보이는 일은 18위(LikeButton.tsx:47:51,:55~:58)이고, 그 바퀴가readApiError를 거기서 부르면 돼요.EditDetailsModal.tsx:102,ReportModal.tsx:58,AddHeaderModal.tsx:96,AddPerformanceModal.tsx:67,ShareDeckModal.tsx:67).ShareDeckModal이 2xx 를 받고id가 없으면 전처럼 「Sharing failed.」 예요. 경로는 201 과{ id }로만 답해요. 2xx 인데 JSON 이 아니면 지금도 catch 로 가요.PublishModal.tsx:221~:232는 같은 일을 제 코드로 이미 해서 그대로 뒀어요.app/community/p/[id]/PatternDetailClient.tsx:292,:890,:911,:1048,:1069,app/community/d/[id]/DeckDetailClient.tsx:148,:183,:269,:623,:737,lib/community/useModuleBuild.ts:115,:151,components/community/PatternCard.tsx:101,:195,DeckDock.tsx:274,FeaturedEditor.tsx:144,:219,ReportQueue.tsx:53,CommunityFeedClient.tsx:349예요.Changelog
Web
경험
언제: 커뮤니티 글 칸의 오류 글을 빌드한 쪽에서 dev 와 견줄 때
교훈: 프록시를 세우거나 서버를 멈추지 말고 Playwright
page.route로 그 경로 하나만 HTML 502 나 413 으로 답하게 하고, 나머지는 진짜 서버에 맡겨요근거: #292 에서 댓글 POST 와 Edit details PATCH 만 가로채 390 과 1440 에서 dev 의 「Network error.」 와 이 브랜치의 「(HTTP 502).」 를 쟀어요
언제: 고친 것을 이미 커밋한 뒤 「고치기 전」 빌드를 만들 때
교훈:
git stash push -- <파일>은 커밋된 고침에 말없이 아무것도 안 하니,git checkout origin/dev -- <파일>로 되돌려 빌드하고git checkout HEAD -- <파일>로 돌아와요근거: #292 에서 stash 가 출력 없이 끝나 git status 가 깨끗했고, 그대로 빌드했으면 「고치기 전」 사진이 고친 판이었어요
바퀴
바퀴 121 · 후보 16 「서버가 HTML 오류 쪽을 돌려줘도 커뮤니티 글 칸이 「Network error.」 대신 서버가 몇 번으로 답했는지 말한다」
다음 바퀴
sort === "liked"를 보지 않아 패턴 30개가 있는 벽에서도 「Nobody has hung anything here yet.」 이 떠요.readApiError를LikeButton.tsx와PatternCard.tsx의 실패 갈래에서 부르면 서버 글이 바로 와요.BodyComposer.tsx:34의previewing이 글이 비어도 그대로라 올린 뒤 글 칸이 사라져요.https://claude.ai/code/session_01DvhhnwQJLYXfjnFh8gg7q4
Generated by Claude Code