Skip to content

[NM-635] 알람킷 종료 후 앱 내 타이머가 남는 현상 해결 - #201

Merged
ParkMazorika merged 4 commits into
developfrom
feature/NM-635-alarmkit-sync
Oct 20, 2026
Merged

ParkMazorika merged 4 commits into
developfrom
feature/NM-635-alarmkit-sync

Conversation

@ParkMazorika

@ParkMazorika ParkMazorika commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

변경 요약

알람을 앱 밖(잠금화면 · Dynamic Island · 워치)에서 끄면 앱 안 만료 카드가 남아 완료를 한 번 더 눌러야 사라지던 문제를 고친다. 만료 카드의 기준을 저장소가 아니라 **시스템 알람(AlarmKit)**으로 둔다.

변경 내용

  • 규칙 — 만료 카드는 알람이 울리는 동안만 남긴다. 만료 시각이 지났는데 시스템에 알람이 없으면 앱 밖에서 끈 것으로 보고 지운다
    • 울리기 전(카운트다운) · 일시정지 타이머, 알람 목록을 알 수 없을 때는 건드리지 않는다
  • TimerAlarmScheduling — liveAlarmIDs()(살아 있는 알람 id) · alarmsChanged(목록 변경) 추가. 기본 구현은 nil · Empty
    • AlarmKitAlarmScheduler — AlarmManager.shared.alarms · alarmUpdates. 위젯이 예약한 알람도 앱 알람이라 함께 나온다
  • DefaultTimerUseCase.syncWithSystemAlarms() — 정리한 타이머는 timerEnded(completed, endedOutsideApp = true)로 알린다
    • 조립 계층이 timer_complete 로 번역하고, 리뷰 요청은 앱 밖 완료로 본다(NM-560)
  • SceneDelegate
    • 활성화 때 reload → refresh → syncWithSystemAlarms
    • 앱이 떠 있는 동안 알람이 바뀌면 같은 정리 + 앱 밖 이벤트 큐 소비 + 리뷰 요청 판단 — 배너로 끄면 카드가 바로 사라진다
    • 큐 소비를 drainOutsideTimerEvents() 로 묶음
  • 완료 인텐트(TimerStopIntent · TimerWidgetStopIntent)는 그대로 — 인텐트가 먼저 지웠으면 맞출 대상이 없어 이벤트가 겹치지 않는다

테스트

  • Domain 단위 테스트 TimerSystemAlarmSyncTests 4개 — 만료 · 알람 없음 → 지움 / 울리는 중 → 남김 / 카운트다운 · 일시정지 → 그대로 / 목록 모름 → 그대로
  • 시뮬레이터
    • 앱을 띄운 채 알람 배너 ✕ → 만료 카드가 바로 사라짐
    • 위젯으로 시작해 울리는 중 앱 열기 → 카드 남음(앱 안 완료로 정리)
    • 워치에서 시작 · 완료 → 정상

체크리스트

  • PR 제목이 [NM-XXX] 요약 형식
  • 브랜치명 <type>/NM-XXX-요약 형식
  • 커밋 메시지 [NM-XXX] type: 요약 형식
  • 셀프 리뷰 완료

ParkMazorika and others added 3 commits October 21, 2026 03:24
만료 카드는 AlarmKit 알람이 울리는 동안만 남긴다. 만료 시각이 지났는데 알람이 없으면
앱 밖(잠금화면 · Dynamic Island · 워치)에서 끈 것으로 보고 지운다 — 앱이 떠 있으면 바로,
아니면 다음 활성화 때. 예전엔 [완료]를 한 번 더 눌러야 사라졌다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it-sync

# Conflicts:
#	Projects/App/Sources/Application/SceneDelegate.swift
@ParkMazorika ParkMazorika added bug Something isn't working enhancement New feature or request labels Oct 20, 2026
@ParkMazorika ParkMazorika self-assigned this Oct 20, 2026
@ParkMazorika ParkMazorika removed the enhancement New feature or request label Oct 20, 2026
Base automatically changed from feature/NM-560-store-review to develop October 20, 2026 19:04
@ParkMazorika
ParkMazorika merged commit 7960fdb into develop Oct 20, 2026
@ParkMazorika
ParkMazorika deleted the feature/NM-635-alarmkit-sync branch October 20, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant