fix(filter): GraphQL 에러 중복 로깅 제거 (#117 follow-up)#118
Conversation
GqlLoggingInterceptor 의 tap.error 와 GraphQLExceptionFilter.format 모두 txError 를 호출해 같은 요청/에러가 두 번 로깅되던 문제 수정. HTTP path (HttpLoggingInterceptor + HttpExceptionFilter) 패턴과 동일하게 에러 로깅 owner 는 필터로 일관화. 인터셉터는 성공 tx 로깅과 응답 시간 헤더 (성공/에러 양쪽) 만 담당. - gql-logging.interceptor.ts: tap.error 에서 txError 제거, setResponseTimeHeader 만 유지 - spec: 중복 txError 미호출 + setResponseTimeHeader 호출 보존 검증 Codex 리뷰 (#117 inline) 지적 반영.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Coverage report
Test suite run success1191 tests passing in 143 suites. Report generated by 🧪jest coverage report action from 2615d19 |
Summary
#117 (P1-3 GraphQL 전용 예외 필터) Codex 리뷰 후속. GraphQL 에러가
GqlLoggingInterceptor.tap.error와GraphQLExceptionFilter.format양쪽에서txError를 호출해 동일 요청/에러에 대한 중복 로그가 발생하던 문제 수정.Scope
gql-logging.interceptor.tstap.error콜백에서this.logger.txError({...})호출 제거setResponseTimeHeader(res, duration)호출은 유지 (에러 응답에서도 응답 시간 헤더 누락 방지)GraphQLExceptionFilter단일화 — HTTP path (HttpLoggingInterceptor+HttpExceptionFilter) 와 동일 패턴gql-logging.interceptor.spec.ts원인 분석
Impact
txError1 건 → 1 건 (중복 0). 에러 카운터·알람 inflation 해소Test plan
gql-logging.interceptor.spec— 에러 시txError미호출 +setResponseTimeHeader호출 검증graphql-exception.filter.spec— 기존 16 케이스 그대로 통과 (필터의txError로깅 보존)