jack and islam
9754881af8
Fix memory leaks and post-playback freeze
...
Fixes:
1. Post-playback freeze: audioPlayerDidFinishPlaying now dispatches to main
thread before updating @Published properties (Swift concurrency violation)
2. Unbounded waveform cache: Implement LRU eviction with 20-entry limit
- Track last access time for each cached waveform
- Evict oldest entry when cache is full
- Prevents unlimited memory growth as voice notes accumulate
3. Audio buffer memory leaks: Wrap computeWaveform in autoreleasepool
- AVAudioPCMBuffer allocations are autoreleased
- Pool ensures buffers are freed promptly
4. Image processing memory: Add autoreleasepool around compression loops
- Each jpegData() call creates temporary objects
- Inner pool per iteration prevents memory spikes during quality search
Memory should now remain stable during extended use.
2025-10-15 17:37:19 +01:00
jack and islam
59cc857fde
Fix UI freeze when receiving voice notes
...
Problem: AVAudioPlayer initialization in VoiceNotePlaybackController.init()
was running synchronously on main thread during view creation, blocking
UI for 50-200ms per voice note.
Solution:
- Remove eager preparePlayer() call from init
- Load duration asynchronously on background queue
- Player is only prepared when playback is actually requested via ensurePlayerReady()
This prevents UI freezes when voice notes appear in the chat.
2025-10-15 17:37:19 +01:00
jack and islam
f0ca1b27c2
Fix critical issues from PR #681 review
...
Critical fixes:
- BinaryProtocol: Return nil for unknown versions (prevents buffer underflows)
- Add BinaryProtocol.Offsets struct to centralize magic numbers
- Replace magic offset calculations with named constants
Security/Privacy:
- FileAttachmentView: Use url.lastPathComponent instead of url.path
(prevents exposing full system paths)
Documentation:
- Fix compression algorithm documentation (zlib, not LZ4)
All tests passing.
2025-10-15 17:37:19 +01:00
jack and islam
5beff8b4dc
Fix binary protocol test fixtures
2025-10-15 17:37:19 +01:00
jack and islam
ba49b885bb
Reset BLE assembler on stalled fragment trains
2025-10-15 17:37:19 +01:00
jack and islam
ac10e906c0
Drop attachment ceilings to 1 MiB and bump release version
2025-10-15 17:37:19 +01:00
jack and islam
119e882574
Guard peer map reads on BLE message path
2025-10-15 17:37:19 +01:00
jack and islam
0acbbdf2e3
Restore BLE broadcasts when notify buffer is saturated
2025-10-15 17:37:19 +01:00
jack and islam
40fe0c8ba5
Fix cleanupLocalFile lookup
2025-10-15 17:37:19 +01:00
jack and islam
7593053137
Resolve image/voice path handling
2025-10-15 17:37:19 +01:00
jack and islam
4dde063027
Hide absolute paths in media messages
2025-10-15 17:37:19 +01:00
jack and islam
8c4fead945
Stub file transfer methods in mock
2025-10-15 17:37:19 +01:00
jack and islam
2543277755
Stub file transfer methods in mock
2025-10-15 17:37:19 +01:00
jack and islam
a8ce4cbf64
Use unique transfer identifiers
2025-10-15 17:37:19 +01:00
jack and islam
93aa714ed4
Preserve packet version when signing
2025-10-15 17:37:19 +01:00
jack and islam
9c7bf26e13
Fix CFMutableData handling
2025-10-15 17:37:19 +01:00
jack and islam
c29c7d83fe
Target image byte size across platforms
2025-10-15 17:37:19 +01:00
jack and islam
7f743d48fe
Normalize mac JPEG color space
2025-10-15 17:37:19 +01:00
jack and islam
27c39332d5
Strip metadata in mac image encoding
2025-10-15 17:37:19 +01:00
jack and islam
53c08d6807
Revert unsupported JPEG option
2025-10-15 17:37:19 +01:00
jack and islam
7efe0a23b1
Align mac image JPEG encoding
2025-10-15 17:37:19 +01:00
jack and islam
8dedc81512
Allow user-selected write access
2025-10-15 17:37:19 +01:00
jack and islam
5cbe9d4aa7
Fix image attachment detection
2025-10-15 17:37:19 +01:00
jack and islam
515fae9e25
Use save panel for mac image export
2025-10-15 17:37:19 +01:00
jack and islam
0946d3921f
Keep processed images for outgoing messages
2025-10-15 17:37:19 +01:00
jack and islam
1d40950118
Lowercase image preview buttons
2025-10-15 17:37:19 +01:00
jack and islam
b404d48ba6
Reblur images via swipe
2025-10-15 17:37:19 +01:00
jack and islam
2f1ba27d51
Allow long-press reblur on images
2025-10-15 17:37:19 +01:00
jack and islam
23124b36b7
Use Photos picker on mac
2025-10-15 17:37:19 +01:00
jack and islam
3e8d05fa2e
Restore mac photo picker access
2025-10-15 17:37:19 +01:00
jack and islam
c36b582209
Display recording milliseconds
2025-10-15 17:37:19 +01:00
jack and islam
3c66ca7499
Harden attachment transfer bookkeeping
2025-10-15 17:37:19 +01:00
jack and islam
a042576652
Describe microphone usage
2025-10-15 17:37:19 +01:00
jack and islam
3c120042a4
Permit mac media library access
2025-10-15 17:37:19 +01:00
jack and islam
4e3603d5e4
Allow mac microphone access
2025-10-15 17:37:19 +01:00
jack and islam
f7ad970a83
Enable mac attachment importers
2025-10-15 17:37:19 +01:00
jack and islam
4cc87633e1
Fix compressed BLE file transfers
2025-10-15 17:37:19 +01:00
jack and islam
2d565ad918
Stop dropping partial BLE frames while assembling notifications
2025-10-15 17:37:19 +01:00
jack and islam
b4cb4d36f1
Log incomplete BLE frames for debugging
2025-10-15 17:37:19 +01:00
jack and islam
7fcef2a9cb
Add detailed logging for BLE fragment assembly
2025-10-15 17:37:18 +01:00
jack and islam
e7dc0e0c5a
Let BLE assembler accept large frames up to hard cap
2025-10-15 17:37:18 +01:00
jack and islam
3b2c7d2f73
Add guard to drop oversized BLE notification assemblies
2025-10-15 17:37:18 +01:00
jack and islam
209f926990
Revert "Raise BLE notification buffer cap for large file transfers"
...
This reverts commit b624523af843475db84e4a846db8dcbe824ae408.
2025-10-15 17:37:18 +01:00
jack and islam
ef8b509ea5
Raise BLE notification buffer cap for large file transfers
2025-10-15 17:37:18 +01:00
jack and islam
06b5bdb6da
Allow file transfers from connected but unverified peers
2025-10-15 17:37:18 +01:00
jack and islam
a5a3efebcb
Copy imported files before sending to preserve access
2025-10-15 17:37:18 +01:00
jack and islam
cd39d8c8c0
Restore iOS file importer for attachments
2025-10-15 17:37:18 +01:00
jack and islam
1046bfec0f
Reduce vertical padding between chat rows
2025-10-15 17:37:18 +01:00
jack and islam
d8c83e25f4
Tighten spacing above media message bubbles
2025-10-15 17:37:18 +01:00
jack and islam
a9fa614416
Gracefully disable mac attachment pickers in sandbox
2025-10-15 17:37:18 +01:00