Duplicated gRPC-response-to-ResponseDirectMessage mapping
- Dominant language
- Rust
- Stars
- 0
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
The conversion from a gRPC message proto to `ResponseDirectMessage` appears identically in both `handle_get_paginated_messages` (lines 226-237) and `handle_sync_messages` (lines 438-449). Same field-by-field map with the same `Uuid::parse_str(...).unwrap_or_else(|_| Uuid::new_v4())` fallback.
hint: Implement `From` for `ResponseDirectMessage` (or a named conversion function). Both call sites collapse to `.map(ResponseDirectMessage::from)`.
Contributor guide
Research direction
Find the implementations of handle_get_paginated_messages and handle_sync_messages, then compare their duplicated ProtoMessage-to-ResponseDirectMessage mappings. Inspect the ProtoMessage and ResponseDirectMessage definitions before choosing the conversion approach. Done means both handlers use the shared conversion and existing Rust tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100