test(listener): add e2e multi-channel notification delivery coverage - #69
Merged
Abd-Standard merged 1 commit intoJun 18, 2026
Conversation
Validate notification delivery across multiple supported channels by wiring the real DiscordNotificationService and NotificationRetryQueue together (mirroring EventSubscriber.processEvent) and mocking only the outbound fetch. Covers: - End-to-end fan-out: one event delivered to every configured channel - Channel-specific payloads: per-URL routing and Discord embed contents (title, type-based color, contract/value fields) - Delivery failures: partial failure isolation, webhook error responses, and network exceptions, each producing meaningful logs - Retry behaviour: failed channel recovers via its retry queue, retry queues stay independent per channel, and exhausted retries escalate to a permanent-failure log
Abd-Standard
pushed a commit
that referenced
this pull request
Jun 22, 2026
…131) Add a NotificationPriority enum (Low/Medium/High/Critical) as a trailing topic on every emitted event, alongside the existing NotificationCategory. Off-chain consumers (alerting, dashboards, paging) can now route by priority — or page on Critical (admin transfer, authorization failure) without decoding the payload. Backward compatibility: priority is added as the LAST topic. Existing listeners keyed off category or the event name keep working unchanged. - Add NotificationPriority contracttype enum to base/events.rs - Append priority as trailing #[topic] on every event struct - Update autoshare_logic.rs publish sites with semantic priority: * Low: GroupActivated/GroupDeactivated (routine lifecycle) * Medium: AutoshareCreated/AutoshareUpdated (operator awareness) * High: ContractPaused/ContractUnpaused (operator review) * Critical: AdminTransferred/AuthorizationFailure (urgent) - Migrate topic helpers from topics.last() to topics.get(n-2) for category (pitfall #69 prevention); add priority_of helper - Update existing tests with priority assertions; add backward-compat shape test verifying category_topic index remains stable All 105 tests pass (cargo test --workspace). Signed-off-by: zeroknowledge0x <zeroknowledge0x@users.noreply.github.com>
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.
Closes #65
Summary
Improves test coverage by validating notification delivery across multiple supported channels. Adds an end-to-end test that wires the real
DiscordNotificationServiceandNotificationRetryQueuetogether (mirroringEventSubscriber.processEvent) and mocks only the outboundfetch— the actual network boundary — so the genuine delivery and retry path is exercised rather than stubbed.A "channel" here maps to a distinct Discord webhook destination (different webhook URLs deliver to different Discord channels, e.g.
#alerts,#ops,#audit), which is how a single deployment fans an event out to several destinations.What's covered
Mapped directly to the issue's tasks and acceptance criteria:
ECONNRESET).New file
listener/src/__tests__/multi-channel-delivery.e2e.test.ts— 10 tests.Verification