Symptom
A merchant subscribed to surcharge.succeeded events is also receiving charge.succeeded events. They should only receive surcharge events, but they get every charge event too.
What you know
Dispatch routes events to merchant endpoints based on subscription filters. The filter evaluator supports:
- Exact match:
"charge.succeeded"matches only"charge.succeeded" - Wildcard suffix:
"charge.*"matches"charge.succeeded","charge.failed" - Catch-all:
"*"matches everything
The merchant's subscription filter is "surcharge.succeeded" but they receive "charge.succeeded" events. This should not happen with an exact match.
Routing Flow
Event (type: "charge.succeeded")
→ Filter Evaluator checks each subscription filter
→ "charge.succeeded" filter → should match ✓
→ "surcharge.succeeded" filter → should NOT match ✗ (but it does!)
→ "refund.*" filter → should NOT match ✓
Log excerpt
[subscription-matcher] Subscriptions matched
eventType="charge.succeeded"
matched=["sub_charge", "sub_surcharge"] ← sub_surcharge shouldn't be here
Hints
TypeScript
TypeScript ready
Test Output
▶
Click "Run Tests" to execute your code