Handle absent media and selection state safely

This commit is contained in:
Mikhail Kilin
2026-05-17 18:41:52 +03:00
parent 679892beca
commit 91e4f118f3
7 changed files with 68 additions and 36 deletions

View File

@@ -169,12 +169,12 @@ rg -n "unwrap\\(|expect\\(|panic!\\(" src
Steps:
- [ ] Replace `photo_info().unwrap()` and `voice_info().unwrap()` with `let Some(...) else { ... }`.
- [ ] Replace `selected_chat_id.unwrap()` with an early return or status message.
- [ ] Review playback/message unwraps in `message_bubble.rs` and convert absent data into graceful UI fallback.
- [ ] Audit mutex unwraps separately; leave only cases where poisoning should be fatal and documented by context.
- [ ] Add tests for missing media metadata and absent selected chat.
- [ ] Run `cargo clippy --all-targets --all-features -- -D warnings`.
- [x] Replace `photo_info().unwrap()` and `voice_info().unwrap()` with `let Some(...) else { ... }`.
- [x] Replace `selected_chat_id.unwrap()` with an early return or status message.
- [x] Review playback/message unwraps in `message_bubble.rs` and convert absent data into graceful UI fallback.
- [x] Audit mutex unwraps separately; leave only cases where poisoning should be fatal and documented by context.
- [x] Add tests for missing media metadata and absent selected chat.
- [x] Run `cargo clippy --all-targets --all-features -- -D warnings`.
Acceptance criteria: