Skip to content

Add interoperable LXMF voice messages - #1075

Merged
torlando-tech merged 24 commits into
mainfrom
feature/voice-messages
Aug 6, 2026
Merged

Add interoperable LXMF voice messages#1075
torlando-tech merged 24 commits into
mainfrom
feature/voice-messages

Conversation

@torlando-tech

Copy link
Copy Markdown
Owner

Summary

  • add interoperable asynchronous LXMF voice messages using the standardized FIELD_AUDIO representation with Ogg/Opus payloads
  • record finalized audio through LXST v0.0.8, with permission handling, preview, cancellation, failure recovery, persistence, and retry
  • derive duration from validated Ogg/Opus metadata and waveform levels from decoded PCM
  • add accessible compact playback bubbles with play/pause, waveform progress, duration, timestamp, and delivery state
  • enforce bounded payload/cache behavior and tokenized mutual exclusion between calls and voice recording
  • preserve voice and generic attachments through Binder transport and failed-message retry

Fixes #463

Verification completed

  • LXST unit tests and physical recorder instrumentation passed on a Samsung SM-G998U1
  • recorded Ogg/Opus independently decoded successfully
  • official Python LXMF to Columba and Columba to official Python voice-message delivery passed
  • focused Ktlint, Detekt, recorder, player, persistence, retry, call/recording concurrency, and ViewModel suites passed
  • Kotlin and Python backend variants compile with LOCAL_LXST_KT unset against published LXST v0.0.8
  • physical recording, preview, cancellation, failed-send retention, playback, decoded-PCM waveform, and compact-bubble checks passed on the development candidate

Verification still running

  • final clean full matrix against exact head 10fc50a9a483594821044b23f645499c048ba9d7
  • independent exact-head review
  • exact-head APK installation and final physical idle/playing visual confirmation

Risk and rollback

The highest-risk areas are Android microphone lifecycle ownership, binary attachment persistence, and playback metadata concurrency. The implementation uses tokenized microphone leases, bounded loading, atomic metadata admission, stale-cache cleanup, and regression coverage for duplicate starts, stale releases, retry reconstruction, and failed recorder finalization. Rollback is the removal of this feature stack and the LXST dependency pin update.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds interoperable Ogg/Opus LXMF voice messages across recording, playback, persistence, retry, and Binder transport.

  • Adds bounded audio parsing, loading, metadata extraction, waveform decoding, and playback UI.
  • Preserves standardized audio fields through attachment extraction and failed-message retry.
  • Coordinates microphone ownership between voice recording and calls, including synchronous teardown cleanup.
  • Extends IPC transport and interoperability tests for binary audio attachments.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
app/src/main/java/network/columba/app/ui/model/MessageMapper.kt Maps standardized audio fields into bounded UI payload references; the previously reported unbounded nested traversal is fixed.
app/src/main/java/network/columba/app/ui/model/AudioAttachmentLoader.kt Resolves bounded inline and repository-owned file payloads with canonical-path, size, cycle, and nesting checks.
data/src/main/java/network/columba/app/data/repository/ConversationRepository.kt Extracts large audio payloads while preserving the enclosing mode-and-payload array required by playback and retry.
app/src/main/java/network/columba/app/viewmodel/MessagingViewModel.kt Integrates recording, sending, retry, and microphone admission; teardown now releases microphone ownership in a synchronous finally block.
rns-ipc/src/main/kotlin/network/columba/app/rns/ipc/AttachmentBlob.kt Extends out-of-band Binder transport to preserve binary audio and generic attachments without oversized inline transactions.
app/src/main/java/network/columba/app/audio/VoiceMessagePlayer.kt Adds lifecycle-managed Ogg/Opus loading, metadata caching, waveform analysis, temporary-file playback, and cleanup.

Sequence Diagram

sequenceDiagram
    participant UI as Messaging UI
    participant VM as MessagingViewModel
    participant Audio as Recorder / Player
    participant Repo as ConversationRepository
    participant IPC as RNS IPC
    participant Peer as LXMF Peer
    UI->>VM: Record and send voice message
    VM->>Audio: Record finalized Ogg/Opus
    Audio-->>VM: Audio bytes
    VM->>Repo: Persist FIELD_AUDIO
    VM->>IPC: Send [AM_OPUS_OGG, bytes]
    IPC->>Peer: Deliver LXMF message
    Peer-->>IPC: Receive FIELD_AUDIO
    IPC->>Repo: Persist inline or extracted payload
    Repo-->>VM: Load message
    VM->>Audio: Resolve, validate, and play payload
    Audio-->>UI: Metadata, waveform, and playback state
Loading

Reviews (4): Last reviewed commit: "fix: always release voice recording leas..." | Re-trigger Greptile

Comment thread app/src/main/java/network/columba/app/ui/model/MessageMapper.kt Outdated
Comment thread data/src/main/java/network/columba/app/data/repository/ConversationRepository.kt Outdated
# Conflicts:
#	app/src/main/java/network/columba/app/ui/screens/MessagingScreen.kt
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@torlando-tech
torlando-tech merged commit 056b11c into main Aug 6, 2026
25 of 29 checks passed
@torlando-tech
torlando-tech deleted the feature/voice-messages branch August 6, 2026 17:53
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.

Add Voice Messages

1 participant