Repository navigation
fix(mobile): stop clearing Android notifications when the badge drops to zero - #2491
Conversation
… to zero expo-notifications' setBadgeCountAsync(0) calls NotificationManager.cancelAll() on Android, so resolving the last pending request also removed unread Bot messages from the shade. Android launchers count notifications themselves, so the app no longer sets the badge there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrtPca5pD72Gdx4CFkQdNi
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrtPca5pD72Gdx4CFkQdNi
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Android phone result on main 37971eb (#2491): an unread DM now stays (PASS), but handled request notifications are not removed (FAIL) (Xiaomi, Android 16 / HyperOS 3, fresh isolated QA Host and store build, battery saver unrestricted and autostart on, app in the background, real Host pushes) Evidence: 2465-android-push/phone-37971eba (commit cf3e655): Steps: (1) Mira DM reply, left unread. (2) Echo secret-input request, submitted with fake data. (3) Echo secret_cli approval, denied via the CLI. Echo replied QA-SECRET-REFUSED, and the Host sent a badge push.
Likely cause (inferred; the release build can't be debugged): Generated by Claude Code |
Requested by Vain · project thread
Why
#2485 passed the phone check on main 2d0bf6e (result), but it surfaced a new problem. An unread Mira DM notification disappeared in the same second as a
kind=badgepush, together with the secret-input request that had just been handled.Cause: when the last pending request is resolved, the Host's badge drops to 0. The Host sends a badge push, and the app's
push-session.reflect()callssetBadge(0)at the same moment. On Android, expo-notifications implementssetBadgeCountAsync(0)asNotificationManager.cancelAll()(badge/BadgeHelper.kt), so every notification in the shade gets cleared, unread DMs included.reflect()itself only dismisses resolvable kinds (approval, question, private input), so the DM was removed bycancelAll.Change outline
native-notifications.ts:setBadgereturns immediately on Android. Android launchers count notifications themselves, and resolvable requests are still dismissed one by one byreflect(). iOS is unchanged.Verification
tscpasses.Generated by Claude Code