Skip to content

Rust SDK: implement admin.dlq.list() / admin.dlq.requeue(id) with test coverage#773

Merged
Mac-5 merged 2 commits into
Synapse-bridgez:mainfrom
coredevdave-cmd:feature/rust-sdk-implement-admin-dlq-760-761
Jun 30, 2026
Merged

Rust SDK: implement admin.dlq.list() / admin.dlq.requeue(id) with test coverage#773
Mac-5 merged 2 commits into
Synapse-bridgez:mainfrom
coredevdave-cmd:feature/rust-sdk-implement-admin-dlq-760-761

Conversation

@coredevdave-cmd

@coredevdave-cmd coredevdave-cmd commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds AdminDlq resource to the Rust SDK under sdks/rust/src/resources/admin/dlq.rs
  • Implements admin.dlq.list()GET /dlq: returns all dead-letter queue entries ordered by moved_to_dlq_at desc
  • Implements admin.dlq.requeue(id)POST /dlq/:id/requeue: replays a failed transaction; 404 responses are explicitly mapped to SynapseError::NotFound (never silent success or a generic 500)
  • Adds DlqEntry, DlqListResponse, and RequeueResponse models to models.rs
  • Wires dlq() accessor onto AdminSynapseClient in client.rs
  • Exports AdminDlq from resources/admin/mod.rs

Test plan

All tests are in sdks/rust/src/resources/admin/dlq.rs using wiremock (no live server):

  • list_returns_dlq_entries_on_200 — happy path for list()
  • list_returns_empty_list_when_dlq_is_clear — empty DLQ returns Ok with empty Vec, not an error
  • list_uses_admin_key_not_public_key — mock requires X-Admin-Key; passes only when admin key is sent
  • requeue_returns_success_on_200 — happy path for requeue(id)
  • requeue_uses_admin_key_not_public_key — mock requires X-Admin-Key; passes only when admin key is sent

Closes #760
Closes #761
Closes #762
Closes #718

…ests

Adds DLQ (dead-letter queue) support to the AdminSynapseClient:
- admin.dlq.list() wraps GET /dlq and returns all failed transaction entries
- admin.dlq.requeue(id) wraps POST /dlq/:id/requeue and explicitly converts
  404 responses to SynapseError::NotFound so missing IDs never surface as a
  silent success or a generic 500
- Includes unit tests (wiremock) covering both happy paths, the not-found
  edge case, and verifying that X-Admin-Key (not X-API-Key) is sent

Closes Synapse-bridgez#760
Closes Synapse-bridgez#761
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@coredevdave-cmd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

webhook_replay (Synapse-bridgez#762):
- AdminWebhookReplay resource: list_failed(filters), replay(id, dry_run),
  replay_batch(ids, dry_run)
- list_failed accepts optional filters: limit, offset, asset_code,
  from_date, to_date (matches ListFailedWebhooksQuery in the handler)
- replay_batch explicitly documents and tests that callers must inspect
  each WebhookReplayResult entry — HTTP 200 does not mean all items
  succeeded
- 8 wiremock unit tests covering happy paths for all three methods,
  per-item result inspection in batch, admin-key enforcement, dry-run
  mode, and filter passthrough
- Wires webhook_replay() accessor onto AdminSynapseClient

OpenAPI spec (Synapse-bridgez#718):
- docs/openapi.yaml covers every endpoint wrapped by the SDK and CLI:
  transactions (list, get, search, export), settlements (list, get),
  stats (status, daily, assets, cache), health (health/live/ready),
  GraphQL, WebSocket message envelope, and all admin endpoints
  (DLQ, webhook replay, locks, settlements, reconciliation, bulk-status)
- Each operation has a summary, request params, and response schema
  with example values

Closes Synapse-bridgez#762
Closes Synapse-bridgez#718
@coredevdave-cmd coredevdave-cmd force-pushed the feature/rust-sdk-implement-admin-dlq-760-761 branch from 3b129d3 to f597e46 Compare June 29, 2026 21:42
@Mac-5 Mac-5 merged commit 844162c into Synapse-bridgez:main Jun 30, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants