Skip to content

[#621] 로그아웃, 회원탈퇴 이후 앱 배지가 그대로 남아있는 현상을 해결한다#646

Merged
opficdev merged 2 commits into
developfrom
fix/#621-badge
Jun 26, 2026
Merged

[#621] 로그아웃, 회원탈퇴 이후 앱 배지가 그대로 남아있는 현상을 해결한다#646
opficdev merged 2 commits into
developfrom
fix/#621-badge

Conversation

@opficdev

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🔗 연관된 이슈

🎯 의도

  • 로그아웃 또는 회원탈퇴 후에도 앱 아이콘 badge count가 이전 알림 수로 남아 있는 문제 해결

📝 작업 내용

📌 요약

  • RootFeature의 auth session 관찰 결과가 로그아웃 상태로 전환될 때 앱 badge count를 0으로 초기화하도록 처리
  • didLogined(false) 처리 시 badge 초기화를 요청하는 테스트 추가

🔍 상세

  • 기존 clearApplicationBadgeCountEffect()를 재사용해 Root 진입 시점뿐 아니라 auth session이 false로 바뀌는 시점에도 badge 초기화 수행
  • 로그아웃과 회원탈퇴 모두 session listener를 통해 didLogined(false) 흐름으로 수렴하므로 동일 경로에서 badge 제거 처리
  • RootFeature didLogined(false)는 앱 badge 초기화를 요청한다 테스트로 badge count 0 요청 검증

📸 영상 / 이미지 (Optional)

@opficdev opficdev self-assigned this Jun 26, 2026

@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

이번 풀 request는 로그아웃 또는 로그인 실패(didLogined(false)) 시 앱 배지 카운트를 초기화하는 clearApplicationBadgeCountEffect()를 추가하고 이에 대한 테스트 코드를 작성했습니다. 리뷰에서는 테스트 코드 실행 시 RootApplicationBadgeCountSpy에서 발생할 수 있는 데이터 레이스(Data Race) 문제를 지적하며 스레드 안전성 확보를 권장하였고, 로그아웃 시점에 화면에 열려있는 시트나 알림창 등의 UI 상태(state.sheet, state.alert)를 안전하게 초기화하도록 제안했습니다.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +48 to +52
await waitUntil {
badgeSpy.counts == [0]
}

#expect(badgeSpy.counts == [0])

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.

high

현재 RootApplicationBadgeCountSpy@unchecked Sendable로 선언되어 있으나, 내부 counts 배열에 대한 동기화 처리가 없어 Data Race가 발생할 수 있습니다.

clearApplicationBadgeCountEffect().run 블록은 협력 스레드 풀(Cooperative Thread Pool)에서 비동기적으로 실행되어 setBadgeCount를 호출하는 반면, 테스트 코드는 @MainActor에서 badgeSpy.counts를 읽기 때문에 동시 접근이 발생합니다.

이 문제를 해결하려면 RootFeatureTestSupport.swift 파일에 정의된 RootApplicationBadgeCountSpy@MainActor로 격리하거나, 내부적으로 NSLock 또는 OSAllocatedUnfairLock 등을 사용하여 스레드 안전성을 확보해야 합니다.

Comment thread Application/DevLogPresentation/Sources/Root/RootFeature.swift
@opficdev opficdev merged commit 8b6c40e into develop Jun 26, 2026
6 checks passed
@opficdev opficdev deleted the fix/#621-badge branch June 26, 2026 05:58
@opficdev opficdev restored the fix/#621-badge branch June 26, 2026 06:47
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.

로그아웃, 회원탈퇴 이후 앱 배지가 그대로 남아있는 현상을 해결한다

1 participant