981 Commits
Author SHA1 Message Date
jack 784a809d07 Add delivery confirmation and read receipts for private messages
- Implement full delivery status flow: sending → sent → delivered → read
- Add visual indicators (gray/green/blue checkmarks)
- Create DeliveryTracker service for managing confirmations
- Add end-to-end encrypted ACK and read receipt messages
- Handle ephemeral peer ID changes with message migration
- Fix message ID preservation in BinaryProtocol
- Ensure proper delivery status for incoming messages
- Add multiple triggers for sending read receipts
- Maintain full backwards compatibility with older clients

Visual indicators:
- ○ Gray circle = Sending
- ✓ Gray check = Sent
- ✓✓ Green double checks = Delivered
- ✓✓ Blue double checks = Read
- ⚠ Red triangle = Failed
2025-07-06 23:44:42 +02:00
jack b880c663c2 Add comprehensive documentation for delivery confirmation feature
- Complete implementation guide
- Test checklist with expected logs
- Explanation of how ephemeral peer IDs are handled
- Visual indicator reference
2025-07-06 22:57:03 +02:00
jack 13d9be9082 Fix read receipts for existing messages when opening chat
Critical fixes:
1. Match messages by sender nickname in addition to peer ID (since peer IDs change)
2. Send read receipts to CURRENT peer ID, not old senderPeerID from message
3. Remove requirement for senderPeerID to be non-nil (blocks older messages)
4. Add extensive logging to trace the flow

The core issue was that peer IDs are ephemeral and change between sessions:
- Rick sends message with peer ID A
- Later, Jack connects to Rick who now has peer ID B
- Read receipt needs to be sent to B, not A
- Messages need to be matched by nickname, not just peer ID
2025-07-06 22:55:51 +02:00
jack d892c790a7 Fix read receipts being overwritten by delivery ACKs
- Added logic to prevent downgrading from 'read' status to 'delivered'
- When an ACK arrives after a read receipt, the read status is preserved
- This fixes the issue where blue checkmarks briefly appear then revert to green
- Applied fix to all message types (main, private, room)
2025-07-06 22:52:10 +02:00
jack 8b79721725 Fix read receipts not being sent for existing messages
- Added app activation observer to send read receipts when app becomes active
- Send read receipts for all unread messages when receiving a new message while chat is open
- Added import for NSApplication/UIApplication notifications
- This ensures messages are marked as read even when opening chat from notifications or returning to app
2025-07-06 22:47:02 +02:00
jack e93d02afd0 Fix read receipts for existing messages when opening chat
- Added delay to ensure messages are loaded before checking
- Fixed logic to check if message is FROM the other person (not TO them)
- Added onAppear handler to send read receipts when view loads
- Added detailed logging to debug the flow
- Now correctly identifies received messages that need read receipts
2025-07-06 22:42:08 +02:00
jack fbe779e684 Fix read receipts and improve UI
- Changed back to bold blue double checkmarks for read status
- Send read receipts for both 'sent' and 'delivered' status messages
- Added onChange handler to send read receipts whenever switching to a private chat
- Made markPrivateMessagesAsRead public so it can be called from views
- This ensures read receipts are sent when opening a chat from notifications or any other way
2025-07-06 22:37:59 +02:00
jack c72c4949ff Make read receipt indicator more prominent
- Changed from double checkmarks to checkmark.circle.fill icon
- Made the icon larger (size 12) and bold
- Used explicit RGB blue color (0.0, 0.478, 1.0)
- This should make it very obvious when a message has been read
2025-07-06 22:33:19 +02:00
jack 1fec1ee315 Fix read receipts using wrong peer ID
- Read receipts were being sent to the current ephemeral peer ID instead of the message's senderPeerID
- This caused read receipts to be lost when peer IDs changed between sessions
- Now using message.senderPeerID consistently for all read receipt sending
- Added detailed logging to track which peer ID receives the read receipt
2025-07-06 22:30:33 +02:00
jack ab5af1546d Add comprehensive logging and force UI updates for delivery status
- Add logging to track what delivery status is shown in UI
- Add logging when green/blue checkmarks appear
- Force complete dictionary reassignment to trigger SwiftUI updates
- Add diagnostics to understand why blue checkmarks aren't showing
2025-07-06 22:26:56 +02:00
jack c9a594d0b5 Fix UI not updating for delivery status changes
- Use message ID instead of index for ForEach to trigger proper updates
- Add explicit objectWillChange.send() when updating delivery status
- Fix scroll-to-bottom logic to use message IDs
- This should make blue checkmarks appear when read receipts are received
2025-07-06 22:22:13 +02:00
jack d162a89ac2 Add debugging and fix read receipts for messages without delivery status
- Add detailed logging to track read receipt generation
- Handle messages that don't have delivery status (older messages)
- Send read receipts for all unread messages when opening chat
2025-07-06 22:14:41 +02:00
jack 6a37c2cb0c Fix message ID not being preserved during decoding
- Fixed BinaryProtocol to actually read and use the message ID
- Pass the decoded ID to BitchatMessage constructor
- This ensures ACKs reference the correct original message ID
2025-07-06 22:05:06 +02:00
jack 942913fb6d Add debugging logs for delivery confirmation
- Track message IDs through the delivery process
- Log ACK generation and processing
- Log status updates in ChatViewModel
- Log read receipt generation and sending
2025-07-06 21:58:07 +02:00
jack e2b0632879 Add read receipts for private messages
- Added ReadReceipt structure and .readReceipt message type
- Added .read delivery status with blue checkmarks in UI
- Send read receipts when viewing a private chat
- Send read receipts immediately for new messages if chat is open
- Update message status from delivered to read when receipt received
2025-07-06 21:49:56 +02:00
jack 2e56245a7e Fix deadlock in DeliveryTracker causing macOS app freeze
- Fixed nested lock acquisition in trackMessage/scheduleTimeout
- Properly handle lock release before calling methods that need locks
- Ensure retryDelivery and handleTimeout don't cause deadlocks
- Release locks before calling external methods
2025-07-06 21:41:41 +02:00
jack 4529a68309 Revert project configuration changes and add DeliveryTracker
- Reverted project.yml to simpler original format
- Reverted project.pbxproj to avoid screen issues
- Added DeliveryTracker.swift to the project files
2025-07-06 21:35:35 +02:00
jack 78cb8b1039 Fix delivery confirmation for private messages
- Pass message ID from ChatViewModel to BluetoothMeshService
- Preserve original message ID when creating ACK messages
- Move delivery tracking to ChatViewModel for consistent IDs
- Update project.yml to match current project structure
2025-07-06 21:25:41 +02:00
jack 10656b49eb Fix crash: Add thread safety to EncryptionService
The crash was caused by concurrent access to CryptoKit signing operations
from multiple threads. Added thread-safe access using a concurrent queue
with barriers for write operations and sync reads.

This fixes the EXC_BAD_ACCESS crash seen in TestFlight build.
2025-07-06 21:02:47 +02:00
jackandGitHub 7c7e23b154 Delete .github/workflows/swift.yml 2025-07-06 19:58:12 +02:00
jack b1f67a105c Add comprehensive privacy policy
- Explains no data collection, no servers, no tracking
- Documents local-only storage including identity key for favorites
- Details encryption methods and user rights
- Emphasizes privacy-first philosophy
- Written in plain language for accessibility
2025-07-06 19:31:55 +02:00
jack 7a90a8cd36 Merge branch 'feature/performance-optimizations' 2025-07-06 10:32:10 +02:00
jack 4ca9bd86b8 Update documentation for performance optimizations
- Add performance features to README.md including LZ4 compression, battery optimization, and network efficiency
- Add comprehensive Performance Optimizations section to WHITEPAPER.md with technical diagrams
- Update architecture diagram to include Compression Service and Battery Optimizer
- Document future performance enhancements including WiFi Direct transport
2025-07-06 10:17:26 +02:00
jack dc9e7242fd Fix unused variable warnings
- Remove unused keyData debug logging variables
- Clean up leftover debug logging comments
2025-07-05 21:36:59 +02:00
jack 463e94f379 Remove local logging functionality
- Delete LoggingService.swift
- Remove all bitchatLog() function calls throughout the codebase
- Update Xcode project to remove LoggingService references
- Clean up debug logging statements from all services and views
2025-07-05 21:36:59 +02:00
jack 2bada2c626 Fix build errors: make aggregationWindow mutable, fix optional unwrapping, correct function name 2025-07-05 21:36:59 +02:00
jack 2ea07c6157 Fix stored property in extension error by moving advertisingTimer to main class 2025-07-05 21:36:59 +02:00
jack e8d12a6910 Fix platform-specific imports in BatteryOptimizer 2025-07-05 21:36:59 +02:00
jack bd75dd2d92 Update Xcode project with new source files 2025-07-05 21:36:59 +02:00
jack dca5a96286 Implement high-impact performance optimizations
- Add LZ4 message compression for 30-70% bandwidth reduction
- Implement adaptive battery optimization with power modes
- Optimize Bloom filter with bit-packed storage and SHA256 hashing
- Create WiFi Direct integration plan for future implementation
- Enable and update Bloom filter tests
2025-07-05 21:36:59 +02:00
jack a82daa5167 Fix unused variable warnings
- Remove unused keyData debug logging variables
- Clean up leftover debug logging comments
2025-07-05 21:26:42 +02:00
jack 4898691a2a Remove local logging functionality
- Delete LoggingService.swift
- Remove all bitchatLog() function calls throughout the codebase
- Update Xcode project to remove LoggingService references
- Clean up debug logging statements from all services and views
2025-07-05 21:23:10 +02:00
jack b6e29de156 Fix build errors: make aggregationWindow mutable, fix optional unwrapping, correct function name 2025-07-05 21:08:50 +02:00
jack 8fc0e02f1d Fix stored property in extension error by moving advertisingTimer to main class 2025-07-05 21:06:53 +02:00
jack 67f18582f0 Fix platform-specific imports in BatteryOptimizer 2025-07-05 21:04:39 +02:00
jack 12a4539b91 Update Xcode project with new source files 2025-07-05 21:03:50 +02:00
jack 6de2a2ed74 Implement high-impact performance optimizations
- Add LZ4 message compression for 30-70% bandwidth reduction
- Implement adaptive battery optimization with power modes
- Optimize Bloom filter with bit-packed storage and SHA256 hashing
- Create WiFi Direct integration plan for future implementation
- Enable and update Bloom filter tests
2025-07-05 21:02:17 +02:00
jackandGitHub 1f9c6ac976 Create swift.yml 2025-07-05 20:49:32 +02:00
jack 1f1a8c9943 Fix sequence diagram bidirectional arrow syntax 2025-07-05 19:52:57 +02:00
jack 4725b3c881 Fix Mermaid diagram syntax errors in WHITEPAPER.md 2025-07-05 19:48:28 +02:00
jack 728e93f397 Update WHITEPAPER.md formatting and regenerate Xcode project 2025-07-05 19:46:39 +02:00
jack 1f890b00ac Add room-wide mandatory retention, update UI formatting, and documentation
- Implement room-wide message retention controlled by room owners
- Change username format from <name> to <@name> throughout UI
- Fix text alignment in chat messages (consistent font sizes)
- Add comprehensive technical whitepaper with Mermaid diagrams
- Update README with current features and commands
- Add retention status indicators and announcements
- Update command help text to use short versions (/j, /m)
2025-07-05 19:35:37 +02:00
jack 81f0022dbc Fix saved messages not loading on app restart
- Load saved messages for saved rooms during app initialization
- Messages are now restored when reopening the app
- Rooms marked as saved will show their message history immediately
2025-07-05 19:35:37 +02:00
jack f7ebcd6032 Add visual save indicator button for rooms
- Add bookmark icon button in room header to toggle save status
- Use bookmark.fill when room is saved, bookmark when not
- Button shows yellow when saved, default color when not
- Integrate with existing /save command functionality
- Add savedRooms published property for reactive UI updates
2025-07-05 19:35:37 +02:00
jack e6aced4cb4 Remove debug section from macOS app info screen 2025-07-05 19:35:37 +02:00
jack 41c2899008 Refactor room commands and improve UX
- Replace /list with /rooms showing all discovered rooms with join status
- Remove /discover command (merged into /rooms)
- Rename /favorite to /save for clarity
- Make room-specific commands (/transfer, /pass, /save) only appear in room context
- Remove voice notes from app info (feature doesn't exist)
- Remove Commands line from app info screen
- Show checkmark (✓) for joined rooms in /rooms output
2025-07-05 19:35:37 +02:00
jack 506c2bc7cb Implement message retention, retry mechanism, and app updates
- Add KeychainManager for secure password storage
- Implement MessageRetentionService for encrypted local storage of favorite room messages
- Add MessageRetryService for automatic retry of failed messages
- Add /favorite command to toggle room retention
- Add /discover command to find active rooms
- Fix all force unwrapped optionals in BluetoothMeshService
- Update app info screen with new features
- Integrate all services with proper cleanup on panic
2025-07-05 19:35:37 +02:00
jack 7151896102 feat: enhance password-protected rooms with key commitments and management
- Add key commitment scheme for immediate password verification
- Implement ownership transfer with /transfer command
- Add password change functionality with /pass command
- Include room metadata in initialization messages
- Remove /help command and rename /changepass to /pass
- Make room names tappable to show sidebar
- Remove spaces in person/room counter display
- Update UI to show lock icons and orange colors for protected rooms
- Fix password verification to work with empty rooms
- Add comprehensive tests for new functionality

This update significantly improves the security and usability of
password-protected rooms by allowing immediate verification without
waiting for encrypted messages.
2025-07-05 19:35:37 +02:00
jack cfded8c4df Fix room UI and membership tracking issues
- Add lock icon to room header for password management
- Change "leave" to "leave room" for clarity
- Fix bug where non-members appeared in room member list
- Only process room messages if user has joined the room
- Initialize room data structures on app launch
- Prevent auto-join when just mentioning a room
2025-07-05 19:35:37 +02:00
jack 8d553adc0c Implement password-protected rooms with encryption
- Room creators can set/remove passwords for their rooms
- Passwords are used to derive encryption keys via PBKDF2
- All messages in password-protected rooms are encrypted with AES-GCM
- Room protection status is announced to all peers
- Password and room data persists across app launches
- Visual lock indicators for password-protected rooms
- Password prompts when joining protected rooms
- Only room creators can modify password settings
- Encrypted messages show placeholder text if password is unknown
2025-07-05 19:35:37 +02:00