Skip to content

develop#700

Merged
chaeyn merged 7 commits into
mainfrom
develop
Apr 23, 2026
Merged

develop#700
chaeyn merged 7 commits into
mainfrom
develop

Conversation

@chaeyn

@chaeyn chaeyn commented Apr 23, 2026

Copy link
Copy Markdown
Member

변경사항

  • 메인 머지

관련 이슈

Closes #

추가 컨텍스트

@chaeyn chaeyn merged commit 7c0d6ac into main Apr 23, 2026
1 check passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces sorting to battle-related repository queries, implements a custom Socket.IO exception listener to handle non-WebSocket request errors more cleanly, and updates application configurations for task scheduling and Redis timeouts. The review feedback suggests adding a secondary sort key (such as id) to the JPA queries to ensure deterministic ordering when timestamps are identical.

LEFT JOIN rivals r ON b.fk_rival_id = r.id
WHERE (r.fk_first_user_id = :userId OR r.fk_second_user_id = :userId)
AND b.battle_status NOT IN ('REJECTED', 'PENDING', 'CANCELED')
ORDER BY b.started_at DESC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

정렬 결과의 일관성(Determinism)을 보장하기 위해 id와 같은 고유한 값을 보조 정렬 키로 추가하는 것이 좋습니다. 특히 페이징 처리가 나중에 추가될 경우, 동일한 started_at 값을 가진 레코드들의 순서가 보장되지 않으면 데이터 누락이나 중복 노출 문제가 발생할 수 있습니다. 또한, Native Query에서 OR 조건과 ORDER BY를 함께 사용하면 데이터량이 많아질 때 성능 저하가 발생할 수 있으므로 관련 컬럼의 인덱스 전략을 확인해 보시기 바랍니다.

Suggested change
ORDER BY b.started_at DESC
ORDER BY b.started_at DESC, b.id DESC

LEFT JOIN rivals r ON b.fk_rival_id = r.id
WHERE (r.fk_first_user_id = :userId OR r.fk_second_user_id = :userId)
AND b.battle_status = 'PENDING'
ORDER BY b.created_at DESC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

위의 findByUserIdWithOutRejected 메서드와 마찬가지로, 정렬의 결정성을 확보하기 위해 id를 보조 정렬 키로 추가하는 것을 권장합니다. created_at이 동일한 경우에도 일관된 순서로 결과를 반환할 수 있습니다.

Suggested change
ORDER BY b.created_at DESC
ORDER BY b.created_at DESC, b.id DESC

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.

3 participants