Repository navigation
fix(mobile): stop calling removed identity clear_badges route on foreground - #14644
Merged
Merged
Conversation
…ground identity-service dropped /notifications/clear_badges in #14207. The mobile foreground hook still POSTed to it and called .json() on Express's HTML 404, logging "JSON Parse error: Unexpected character: <" on every foreground. The server-side badge count is now reset by pedalboard's notification_seen listener, so the client only needs to clear the local badge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
Problem
Signed-in mobile builds log this every time the app comes to the foreground:
It shows up on Android 16 (RN 0.79.5), the 1.5.186 RC on a Saga (Android 14), and iOS 26.5 (RN 0.81.6, #14642), so it isn't tied to the RN version.
Cause
useResetNotificationBadgeCountruns on every foreground. It callsaudiusBackend.clearNotificationBadges, which POSTs toidentityservice.audius.co/notifications/clear_badgesand then calls.json()on the response. #14207 removed that route from identity-service on 2026-04-30, so Express now returns its HTML 404 page:The
catchpasses the bare error toconsole.error, which produces the log line above.Evidence
I foregrounded the signed-in iOS 26.5 release build on a simulator and read CFNetwork logs from the unified log:
Both earlier occurrences that session (17:17:04 and 17:18:05) were also a 404 from identity, 2 ms before the error. Each one came right after UIKit cleared the app's deactivation reasons. On iOS,
useEnterForegroundalso fires oninactive -> active(Control Center, the notification shade, the app switcher), so the "about once a minute" pattern was how often the app was re-activated, not a timer. In the same session, a process that stayed in the foreground for 5 hours made no 404s and logged no errors.clear_badgesis the only identity route inAudiusBackendthat no longer exists. I checked every other path it calls againstidentity-service/src/routes.Fix
clear_badgesrequest andaudiusBackend.clearNotificationBadges. It had no other callers.PushNotifications.setBadgeCount(0)) on foreground.The server-side
PushNotificationBadgeCounts.iosBadgeCountis now reset to 0 by pedalboard'snotification_seenlistener (apps/notifications/src/notificationSeenListener.ts) when notifications are marked seen. This PR doesn't change server behaviour: the reset on app open has already been gone since #14207.Testing
tscshows no errors in the changed files.🤖 Generated with Claude Code