Skip to content

Conversation

@VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Jan 13, 2026

🎯 Goal

Deferring the IO operations done in the AudioRecordingController to the IO dispatcher (to resolve the StrictMode violations) introduced a race condition, where the MotionEvent.ACTION_UP is ignored, and the UI is not reset properly. (easily observable when the user taps the record button instead of holding it)

Merge after: #6077

🛠 Implementation details

Add detection for the intermediate state of the AudioRecordingController, where the startRecording method is suspended by the file creation, but the user cancels the started recording

🎨 UI Changes

Before After
short_tap_xml_before.mp4
short_tap_xml_after.mp4

🧪 Testing

  1. Open XML sample
  2. Open channel
  3. Quickly tap on record button
  4. The snackbar info should be shown, not stuck in 'held' state

Summary by CodeRabbit

  • Bug Fixes
    • Fixed audio recording content getting stuck in 'held' state.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.25 MB 0.00 MB 🟢
stream-chat-android-offline 5.48 MB 5.48 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.62 MB 10.62 MB 0.00 MB 🟢
stream-chat-android-compose 12.84 MB 12.84 MB 0.00 MB 🟢

@VelikovPetar VelikovPetar marked this pull request as ready for review January 16, 2026 09:38
@VelikovPetar VelikovPetar requested a review from a team as a code owner January 16, 2026 09:38
@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Walkthrough

Changes add a bug fix entry to the changelog regarding audio recording being stuck in a held state, and modify gesture event handling in the message composer to allow gesture-end actions (ACTION_UP/ACTION_CANCEL) to proceed during recording state transitions.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added new Fixed entry documenting the audio recording held-state bug resolution.
Gesture Handling Logic
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
Introduced conditional logic to permit gesture-end actions (ACTION_UP/ACTION_CANCEL) during in-progress recording transitions via shouldAllowTransitionWindow guard. Added isGestureEndAction and isInRecordingTransition checks; conditionally resets UI state when transition is active.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • aleksandar-apostolov

Poem

🐰 A rabbit hops with glee today,
Gesture flows now find their way,
Recording transitions smooth and clear,
No more stuck states we need to fear—
The held state ghost has fled away! 🎙️✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing audio recording content stuck in 'held' state, with (XML) indicating scope.
Description check ✅ Passed Description includes Goal, Implementation details, UI Changes with before/after videos, and Testing steps. Contributor/Reviewer checklists are incomplete but core sections are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 252c414 and e326707.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{kt,kts}

📄 CodeRabbit inference engine (AGENTS.md)

Format and apply Kotlin style with Spotless (4 spaces, no wildcard imports, licence headers)

Files:

  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
**/*.kt

📄 CodeRabbit inference engine (AGENTS.md)

**/*.kt: Use @OptIn annotations explicitly; avoid suppressions unless documented
Document public APIs with KDoc, including thread expectations and state notes

Files:

  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-ui-components/**/*Test.kt : Record Shot baselines when behaviour changes in XML kit UI tests
📚 Learning: 2025-12-17T15:00:07.506Z
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-ui-components/**/*Test.kt : Record Shot baselines when behaviour changes in XML kit UI tests

Applied to files:

  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
📚 Learning: 2025-12-17T15:00:07.506Z
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-compose/**/*.kt : Compose previews should use `StreamPreview` helpers

Applied to files:

  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
📚 Learning: 2025-12-17T15:00:07.506Z
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-compose/**/*Test.kt : Add Paparazzi snapshots for Compose UI regressions and run `verifyPaparazziDebug`

Applied to files:

  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
📚 Learning: 2025-12-17T15:00:07.506Z
Learnt from: CR
Repo: GetStream/stream-chat-android PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T15:00:07.506Z
Learning: Applies to **/stream-chat-android-compose/**/*.kt : Compose components should follow noun-based naming (e.g., `MessageList`, `ChannelListHeader`)

Applied to files:

  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Test compose (2)
  • GitHub Check: Test compose (0)
  • GitHub Check: Test compose (1)
  • GitHub Check: base-android-ci / Run unit tests
  • GitHub Check: base-android-ci / Run static checks
  • GitHub Check: base-android-ci / Build
  • GitHub Check: compare-sdk-sizes / Compare SDK sizes
🔇 Additional comments (3)
CHANGELOG.md (1)

64-64: Changelog update looks good.

Entry is clear and matches the PR intent.

stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt (2)

453-458: Good transition-window guard for end-of-gesture events.
This should prevent ACTION_UP/ACTION_CANCEL from being ignored while recording startup is still in flight.


541-559: Reset-on-transition for end actions looks correct.
Clearing UI when start is pending should avoid stuck “held” visuals while still triggering cancel/release paths.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@VelikovPetar VelikovPetar enabled auto-merge (squash) January 20, 2026 08:14
@sonarqubecloud
Copy link

@VelikovPetar VelikovPetar merged commit 8dfb4df into develop Jan 20, 2026
14 checks passed
@VelikovPetar VelikovPetar deleted the bug/AND-954_fix_audio_recording_stuck_in_held_xml branch January 20, 2026 08:36
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.

3 participants