Fix/round2 p2 - #11
Merged
Merged
Conversation
Scope: 27 files changed (3 new), +246/-986 lines. Build verified. Architecture & data layer: - Inject IChatRepository instead of ChatRepositoryImpl in ChatViewModel - Add Hilt NetworkModule to provision BleTransportImpl via DI - Use shared replyScope + goAsync in ReplyReceiver (prevents process death) - Consolidate 21 settings flows into single combine() in SettingsViewModel - Unify parseName() via PeerNameParser utility Code quality: - Remove duplicate composeOptions from 7 build.gradle.kts files - Consolidate ~150 duplicate and ~50 dead MD3E strings from strings.xml - Create shared TimeUtils.formatMessageTime() replacing 3 duplicated formatters - Delete stale Room schema files (v1-v3) from wrong package path UI fixes: - Replace hardcoded "Peer" with R.string.default_peer_name string resource - Remove FLAG_SECURE from MainActivity (blocked accessibility + screenshots) - 3 UI files now use shared TimeUtils for timestamp formatting
- BleTransportImpl: isAvailable lazy -> real-time BT check, fix peer ID bug, NPE on restart - BleGattClient: effective MTU tracking (negotiated vs config), reject oversized chunks - BleGattServer: stale entry cleanup by device name on reconnect (MAC randomization workaround) - PendingMessageRepository: pendingCount/pendingMessages StateFlow, auto-retry on peer online - FileManagerImpl: media dir creation moved to init - IChatRepository: securityEvents marked with removal TODO - Delete OobVerificationDialog + ViewModel (522 lines dead code, encryption removed) - values-ar: +41 Arabic translations for BLE, transport, dialogs, badges - .gitignore: add entries for worktrees, cascade dirs, AGENT.md
Add comprehensive unit tests for 7 repository implementations: - ChatManagementRepositoryTest: chat CRUD, message deletion/forwarding - FileManagerImplTest: file save/read operations, edge cases - MessageAttachmentRepositoryTest: attachment save/retrieve/delete, grouped messages - MessageRepositoryTest: text/image send, offline queuing, transport failures - PendingMessageRepositoryTest: queue operations, retry with backoff - ReactionRepositoryTest: add/remove/list reactions - SettingsRepositoryTest: all preference read/write flows Refactor production code for testability: - MessageAttachmentRepository: inject ioDispatcher (default Dispatchers.IO) - SettingsRepository: inject prefsStore DataStore (default context.dataStore) Remove unused imports from 4 existing test files.
- Pollutes single test: remove File cleanup block in FileManagerImplTest - Shared mutable state: remove unused callIndex in MessageAttachmentRepositoryTest - Mock leakage: add unmockkAll() to MessageRepositoryTest @after - Null-safety: replace getOrNull()!! with getOrThrow() in SettingsRepositoryTest - Stale naming: rename copyMessageToChat test to forwardMessage delegation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.