[Bug]: Voice recording doesnt stop sometimes when user plays an recording or opens an attachment

Open
#3,678 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
ios, swift

Research direction

The issue names StreamChatUI's VoiceRecordingVC audioPlayer callback and ChatMessageListRouter.showGallery entry points; start by tracing those flows and reproducing the intermittent case on the stated iOS and Xcode versions. Done means recording reliably stops when playback begins or an attachment opens, verified against both reproduction steps.

Written by the indexing model from the issue text.

Description

🐞 Bug
Actual behaviour

We have added custom code so that,

  1. Voice recording stops if user plays any already sent recordings
    class HMECustomVoiceRecordingViewController: VoiceRecordingVC { override func audioPlayer(_ audioPlayer: any AudioPlaying, didUpdateContext context: AudioPlaybackContext) { if (content.state == .locked || content.state == .recording), context.state == .loading { self.audioRecorder.stopRecording() } super.audioPlayer(audioPlayer, didUpdateContext: context) } }
  2. Or User opens any attachmentclass HMECustomChatMessageListRouter: ChatMessageListRouter { weak var galleryShownDelegate: HMECoachChatShowGalleryDelegate? override func showGallery(message: StreamChat.ChatMessage, initialAttachmentId: AttachmentId, previews: [any GalleryItemPreview]) { super.showGallery(message: message, initialAttachmentId: initialAttachmentId, previews: previews) galleryShownDelegate?.galleryViewShown() } }
Expected behaviour

Recording has to be stopped

Steps to reproduce
1. Start recording
2. Open an attachment or play already sent recording

Note: This is an intermittent issue
Which packages are you using?

StreamChatUI

Which SDK version are you using?

4.77.0

Which iOS version is the issue reproducible?

18.4.1

Which iPhone Device is the issue reproducible?

iPhone 16

Which Xcode version are you using?

16.2

Dominant language
Swift
Stars
975
Forks
236
Avg merge
1d 11h
Merged PRs (30d)
46

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GetStream/stream-chat-swift

All issues in GetStream/stream-chat-swift

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.