fix(streak): format reminder title templates#337
Merged
Conversation
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.
Summary
스트릭 보호 알림 메시지의 title 템플릿도 streak count로 포맷하도록 수정했습니다. 랜덤 메시지 선택에 따라 실패하던
StreakProtectionSchedulerTest검증도 title/body 전체 기준으로 바꿨습니다.Problem
STREAK_PROTECTION메시지 중 일부는%dplaceholder를 body가 아니라 title에 포함합니다. 기존 스케줄러는 body만String.format으로 치환해서, 해당 메시지가 랜덤 선택되면 실제 알림 title에%d가 그대로 노출될 수 있었습니다. 테스트도 body에만 streak count가 있다고 가정해 랜덤 메시지 선택에 따라 비결정적으로 실패했습니다.Solution
알림 요청 생성 시 title과 body를 모두 현재 streak count로 포맷합니다. 테스트는 title과 body를 합친 실제 알림 메시지 전체에 streak count가 포함되는지 검증하도록 변경했습니다.
Changes
StreakProtectionScheduler에서message.getTitle()에도String.format적용messageContainsStreakCount테스트를 title/body 전체 검증으로 변경Example
기존에는 title 템플릿이
%d일 스트릭이 기다려요인 메시지가 선택되면%d가 그대로 전송될 수 있었습니다. 이제 현재 streak가 7이면7일 스트릭이 기다려요로 포맷됩니다.Related Issues
없음
Validation
./gradlew test --tests StreakProtectionSchedulerTest --rerun-tasks3회./gradlew spotlessCheck./gradlew check