Skip to content

Promote the Android audio service before building sources and retry refused starts on resume - #1696

Merged
kevmo314 merged 4 commits into
mainfrom
fix/audio-foreground-service
Oct 24, 2026
Merged

kevmo314 merged 4 commits into
mainfrom
fix/audio-foreground-service

Conversation

@kevmo314

@kevmo314 kevmo314 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
  • chat_panel.dart: findChildIndexCallback looks keys up in a map built once alongside keys instead of a linear scan that allocated a Key per comparison (O(n²) when a long list shifts).
  • uniqueKeys tracks the next suffix per repeated key instead of retrying from #1 each time. Suffixes are still numbered from the oldest, so keys stay stable as messages arrive.
  • emote.dart: only the backend call is retried; JSON/fromJson errors can't succeed on retry, so they're reported right away and the cache is used. The test-only retryDelay/reportError parameters are replaced by @visibleForTesting top-level emoteRetryDelay/reportEmoteError.
  • emote.dart: concurrent getEmotes calls for the same channel as the same signed-in user (the chat and the message input both fetch on channel open) share one in-flight fetch, so on a cold cache they don't both call the backend and write the cache file at the same time. The in-flight key and the disk cache are scoped by Firebase Auth uid (or anon), since Twitch emotes depend on who's signed in.
  • views.dart: removed the defaultChannels alias and _channelsFromJson, inlining both into their single uses. Tests now check channels. channels no longer re-wraps the already-unmodifiable _channels.
  • stream_preview.dart: check mounted/_isTwitch after the 2s quality delays before running JS, and cancel _overlayTimer in dispose.
  • main.dart: isFatalFlutterError treats details.silent errors as non-fatal, and FlutterError.onError is a single recordFlutterError(details, fatal: ...) call.

flutter analyze is clean and flutter test passes (470 tests).

  • AudioModel runs syncs one at a time (coalescing queued ones), so an older sync still awaiting the permission check can't land after a newer clear.
  • The service stops via stopSelfResult(startId) and only drops foreground state when that succeeds, so clearing can't cancel a newer queued start.

@kevmo314
kevmo314 merged commit 1dda364 into main Oct 24, 2026
10 checks passed
@kevmo314
kevmo314 deleted the fix/audio-foreground-service branch October 24, 2026 05:41

This branch was successfully deployed

2 active deployments
ios-testflight — 35f749c1 Deployed Oct 24, 2026 by kevmo314 via ios / ipa #1748
android-internal — 35f749c1 Deployed Oct 24, 2026 by kevmo314 via android / apkaab #1748
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