Skip to content

fix: battle finish/#645#646

Merged
Finefinee merged 2 commits into
developfrom
fix/battle-finish/#645
Apr 7, 2026
Merged

fix: battle finish/#645#646
Finefinee merged 2 commits into
developfrom
fix/battle-finish/#645

Conversation

@hjbin-25

@hjbin-25 hjbin-25 commented Apr 6, 2026

Copy link
Copy Markdown
Member

변경사항

  • Battle.accept(): 배틀 종료 시각을 수락일 자정 기준에서 수락 시각 + N일(72시간 단위)로 변경
    • 4/6 22:00 수락 + 3일 → 기존 4/9 00:00 → 4/9 22:00으로 수정
  • FindDetailedBattleInfoService, FindAllBattleInfoService: expireDate에서 .minusDays(1) 제거
    • endAt이 더 이상 자정이 아니므로 endAt의 KST 날짜가 곧 마지막 활동일
  • UserExpHistoryJpaRepository.findAverageExpForBattles 쿼리: < end_at::date<= end_at::date
    • 종료 당일 exp 집계가 누락되던 문제 수정
  • 위 변경에 맞게 BattleTest, FindAllBattleInfoServiceTest 수정

관련 이슈

Closes #645

추가 컨텍스트

  • 스케줄러 및 조회 시 lazy finish(isExpiredInProgress) 흐름은 변경 없음
    endAt.isBefore(now) 판단 기준이 동일하게 유지되므로 자연스럽게 적용됨
  • 이전 커밋([FIX] 배틀 종료 이상 #641)에서 expireDate가 오늘 날짜로 고정되는 버그를 수정했으나,
    종료 시각 계산 자체의 의도가 잘못되어 있어 근본 원인을 이번에 수정

@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 updates the battle expiration and experience history logic by removing the one-day offset and adopting a duration-based calculation using Instant. The review feedback highlights potential edge cases where a battle ending exactly at midnight could lead to incorrect date inclusion in SQL queries and service-level date conversions. Additionally, it was noted that the zoneId parameter in the Battle.accept method is now redundant and should be removed to improve code cleanliness.

@Finefinee Finefinee closed this Apr 7, 2026
@hjbin-25 hjbin-25 reopened this Apr 7, 2026

@Finefinee Finefinee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

72시간 단위가 무슨 소리인지 모르겠어요

@Finefinee Finefinee merged commit 75a52dc into develop Apr 7, 2026
3 checks passed
@Finefinee Finefinee deleted the fix/battle-finish/#645 branch April 7, 2026 01:42
@Finefinee Finefinee added the bug 기능이 정상적으로 작동하지 않음 label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 기능이 정상적으로 작동하지 않음

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants