[Fix] PostgreSQL 감사 이력·알림 조회 500 오류 수정 - #140
Merged
Merged
Conversation
- nullable cursor와 선택 필터를 포함한 고정 JPQL을 Criteria 쿼리로 변경 - 값이 전달된 조건만 동적으로 추가해 PostgreSQL SQLSTATE 42P18 방지 - 감사 이력의 정렬 및 cursor 페이지네이션 동작 유지 - 무필터 감사 이력 조회와 알림 cursor·미읽음 필터 회귀 테스트 추가 - H2 및 PostgreSQL 16 통합 테스트 검증
Contributor
|
개빠르시네요 |
Contributor
|
CriteriaBuilder로 null 조건을 제외하도록 변경한 방향은 적절하고, 기존 필터·정렬·cursor 처리도 유지되는 것을 확인했습니다. 다만 추가된 두 통합 테스트는 @activeprofiles("test") 때문에 실제로는 H2로 실행됩니다. 이번 장애가 PostgreSQL에서만 발생했던 만큼, CI의 PostgreSQL 환경에서 /audit-events?limit=100과 /notifications?size=20이 200을 반환하는 회귀 테스트를 추가해 주세요. 이 테스트까지 확인되면 머지해도 좋을 것 같습니다. |
Contributor
|
기존 이슈도 H2에서만 확인이 되었기에 실배포환경에서 오류가 떴던것처럼 미리 테스트 해보시고 알려주십셔 |
hywznn
previously approved these changes
Aug 11, 2026
CI에서 활성화되는 PostgreSqlAuditNotificationQueryIntegrationTest를 추가했습니다. DynamicPropertySource로 POSTGRES_TEST_* 환경 변수를 datasource에 연결하고, pg_catalog.version() 검증을 통해 실제 PostgreSQL에서 실행되는 것도 명시적으로 확인합니다. 해당 테스트에서 아래 요청이 200을 반환하고 seeded 데이터를 정상 조회하는지 검증했습니다. - GET /api/v1/audit-events?limit=100 - GET /api/v1/notifications?size=20 로컬 psql DB에서도 테스트 통과를 확인했습니다.
…o/server into fix/audit_events_500_error
hywznn
approved these changes
Aug 11, 2026
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.
개요
운영 환경의
/agent화면에서 Agent 이력을 불러오지 못하고, 헤더 알림 조회도 함께 실패하는 문제를 수정합니다.브라우저 네트워크 로그에서 다음 요청이
500 Internal Server Error를 반환했습니다.GET /api/v1/audit-events?limit=100GET /api/v1/notifications?size=20원인
감사 이력과 알림 조회 JPQL은 선택 필터와 cursor를 다음과 같은 형태로 처리하고 있었습니다.
cursor나 선택 필터가 전달되지 않으면 PostgreSQL이
NULLplaceholder의 타입을 추론하지 못해SQLSTATE 42P18이 발생했습니다. H2에서는 동일 쿼리가 정상 동작하기 때문에 기존 통합 테스트만으로는 운영 환경의 실패를 발견하기 어려웠습니다.변경 사항
감사 이력 조회
CriteriaBuilder로 실제 값이 전달된 필터만 조건에 추가하도록 변경했습니다.created_at,audit_event_id기반 cursor 페이지네이션과 정렬·조회 제한을 유지했습니다.알림 조회
unreadOnly와 cursor 조건은 요청된 경우에만 추가하도록 변경했습니다.회귀 테스트
GET /api/v1/audit-events?limit=100을 호출하는 시나리오를 추가했습니다.unreadOnly필터를 단독·조합으로 사용하는 시나리오를 추가했습니다.테스트
H2 API 통합 테스트
BUILD SUCCESSFULPostgreSQL 통합 테스트
pg-test컨테이너에 검증용 임시 DB를 생성했습니다.--rerun-tasks로 위 두 통합 테스트를 다시 실행했습니다.BUILD SUCCESSFUL영향 범위