feat(relay): return full envelope metadata and payload_hex in GET /v1/relay/mailboxes/:id
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start in src/http_server.rs around lines 165-235, where the GET mailbox route calls handle_get_mailbox, then read src/relay.rs and the WAL and Redis recovery code in src/storage.rs and src/redis_store.rs to see where payload_hex is kept per envelope. Return an items array with payload_hex next to the existing envelopes array. Done when tests/milestone10_node_test.rs round-trips the exact submitted payload_hex and the 13 existing tests still pass. The ack endpoint and WAL compaction are separate design work.
Written by the indexing model from the issue text.
Description
Description
Currently, sonaraim-node stores payload_hex in WAL and Redis (src/storage.rs, src/redis_store.rs), but GET /v1/relay/mailboxes/:id (src/http_server.rs:170-185) only returns envelope ID strings ({"envelopes":["env_b2b_1_..."]}) without payload_hex or sender_did. As a result, sonaraim-app cannot decode and render the actual card or P2P message content queued in the mailbox.
Affected Files
src/http_server.rs:165-235src/relay.rs:1-127src/storage.rs:160-254
Evidence (Current Code Snippet)
// src/http_server.rs:172-177
("GET", p) if p.starts_with("/v1/relay/mailboxes/") => {
let mbox = p.trim_start_matches("/v1/relay/mailboxes/");
handle_get_mailbox(&st, mbox)
}
Impact & Historical Context
- Impact: Without returning
payload_hex(andenvelope_id,recipient_mailbox_id) inenvelope_objectsonGET /v1/relay/mailboxes/:id, downstream clients (sonaraim-app) only see opaque IDs and cannot render real cards or messages. - Historical Context: Parent Meta-Issue
alfonsodg/sonaraim#15. Extendsalfonsodg/sonaraim-node#3and#6.
Proposed Solution
- Store
(envelope_id, payload_hex)inNodeState/RelayQueuewhen handlingPOST /v1/relay/envelopesand during WAL/Redis recovery. - In
GET /v1/relay/mailboxes/:id, return both"envelopes": [...](for backward compatibility) and"items": [{"envelope_id": "...", "recipient_mailbox_id": "...", "payload_hex": "..."}]. - Add
POST /v1/relay/mailboxes/:id/ackto acknowledge/pop delivered envelopes and trigger WAL compaction.
Acceptance Criteria
- Functional:
GET /v1/relay/mailboxes/:idreturns"items"containing the exactpayload_hexsubmitted toPOST /v1/relay/envelopes. - Code Quality: All files in
src/strictly< 300lines;cargo fmt --checkandcargo clippy -- -D warningspass. - Tests: TDD tests in
tests/milestone10_node_test.rsverifypayload_hexround-trip throughPOST /v1/relay/envelopes->GET /v1/relay/mailboxes/:id. - Regression: Existing
"envelopes"array contract remains intact so all 13 existing tests pass.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alfonsodg/sonaraim-node
-
bug(node): SigV4 presign date applies the epoch offset twice — media uploads can never validateOpenarea::node effort::s impact::medium priority::medium source::auto status::review type::bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
alfonsodg/sonaraim-node#29 · 1 comment ·
-
area::node effort::xs impact::low priority::low source::auto status::review type::docs
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
alfonsodg/sonaraim-node#28 · 1 comment ·
-
area::node effort::s impact::medium priority::low source::auto status::review type::docs
Difficulty 3/5 1-2 days Newbie friendliness 72/100
alfonsodg/sonaraim-node#27 · 1 comment ·
-
area::node effort::m impact::medium priority::medium source::user status::review type::refactor
Difficulty 1/5 Under an hour Newbie friendliness 20/100
alfonsodg/sonaraim-node#26 · 1 comment ·
-
area::node effort::m impact::high priority::medium source::auto status::review type::bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
alfonsodg/sonaraim-node#25 · 2 comments ·
All issues in alfonsodg/sonaraim-node
Similar issues
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day