Skip to content

fix(android): discard audio prepared after leaving chat - #433

Open
plotarmordev wants to merge 1 commit into
leepokai:devfrom
plotarmordev:feat/17-open-upstream-pr-voice-notes-and-audio-i
Open

plotarmordev wants to merge 1 commit into
leepokai:devfrom
plotarmordev:feat/17-open-upstream-pr-voice-notes-and-audio-i

Conversation

@plotarmordev

Copy link
Copy Markdown
Contributor

Summary

A small follow-up to #364 (voice notes and audio in chat), Android only. It replaces #432: same commit, opened from this branch instead.

On Android, if you left a chat while a voice note was still loading, the player could finish preparing after its card was gone and start playing with nothing on screen to stop it. SharedAudio now checks whether the card was released when the player comes back from preparing; if so, it releases that player right away and never starts it.

  • SharedAudio.kt: release a player that finishes preparing after the card was released, instead of keeping and starting it.
  • SharedAudioTest.kt: a regression test that releases a card while its sound prepares, then checks that the player is released, never plays, and that a second release does nothing.
  • Docs: docs/features/file-attachments.md and the user manual's web/content/docs/conversations.mdx.

iPhone and desktop are unaffected: they already drop a note that loads after its card is gone, and #364's iPhone tests cover a card closed mid-load. The terminal UI doesn't play audio.

I left the version bump and the WhatsNew.md sections for you to add when you release; my release notes are below.

Validation

  • Android: :app:testDebugUnitTest passes with SharedAudioTest at 10/10, including the new test.
  • Not run on the emulator: the race depends on when the system's media player finishes preparing, which I can't time from a UI test, so the unit test holds the prepare step open to reproduce it.

What's New: iPhone

zh-Hant

en-US

What's New: Android

zh-Hant

  • 在語音訊息載入時離開聊天,該語音不會在離開後才開始播放。

en-US

  • Leaving a chat while a voice note is loading no longer lets it start playing afterward.

@github-actions github-actions Bot added bug Something isn't working P2: medium Real problem with a workaround or limited reach. Fix when convenient. labels Nov 12, 2026
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

Type: bug fix | Areas: Android, web, docs | Priority: P2: medium

Android now releases audio that finishes preparing after its chat card is removed.

  • Android voice notes do not start after their chat card disappears.

plotarmordev explicitly deferred the version bump and release-note files to release. They also reported skipping emulator validation because the preparation timing is controlled in the unit test. Tests were not rerun during this review.

Reviews (1) · Last reviewed commit: "fix(android): discard audio prepared aft..." · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working P2: medium Real problem with a workaround or limited reach. Fix when convenient.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant