fix(listdisputes): use NOSTR_DISPUTE_EVENT_KIND for dispute filter#168
Conversation
`listdisputes` returned no results because `create_seven_days_filter` hardcoded `NOSTR_ORDER_EVENT_KIND` (38383) for every list kind. Dispute events are published by mostrod under `NOSTR_DISPUTE_EVENT_KIND` (38386), so the filter never matched and the public dispute queue always rendered as empty even when disputes existed on the relays. Pass the event kind into `create_seven_days_filter` and select the right constant per `ListKind` (orders → 38383, disputes → 38386). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR refactors ChangesEvent kind parameterization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
listdisputesalways returned an empty table even when disputes existed on the configured relays.create_seven_days_filterinsrc/util/events.rshardcodedNOSTR_ORDER_EVENT_KIND(38383) as the Nostrkindfor every list kind it served. Dispute events are published bymostrodunderNOSTR_DISPUTE_EVENT_KIND(38386), so the#z=disputefilter never matched anything.create_seven_days_filterand select the right constant perListKind(orders → 38383, disputes → 38386).Reproduction
With a Mostro instance that has at least one dispute (any status), and
MOSTRO_PUBKEYpointing at it:But querying the same relay directly returns the event:
After the fix,
listdisputesrenders the row.Test plan
cargo build --releasepasses.mostro-cli listdisputesagainst a Mostro instance with at least one dispute returns the dispute(s).mostro-cli listordersstill works (regression check — same helper, different kind).🤖 Generated with Claude Code
Summary by CodeRabbit