Skip to content

fix: use scard for event count, index webhooks by event, longer 401 cooldown, verify cancelRetry - #396

Merged
ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
ogundelevictory:fix/perf-bugs-368-369-370-371
Sep 25, 2026
Merged

ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
ogundelevictory:fix/perf-bugs-368-369-370-371

Conversation

@ogundelevictory

Copy link
Copy Markdown
Contributor

Summary

Fix two performance issues and two bugs in a single PR:

Why

How to test

Linked issues

Closes #368
Closes #369
Closes #370
Closes #371

…ooldown, verify cancelRetry

- SmartDropLabs#368: Replace smembers with scard in getEventCount to avoid loading all
  event IDs into memory for a simple count.
- SmartDropLabs#369: Add per-event-type index sets (webhooks:event:{type}) so
  listActiveForEvent fetches only relevant webhook IDs from Redis instead
  of loading every webhook record and filtering in JS.
- SmartDropLabs#370: Use 10x longer circuit breaker cooldown for 401 auth failures vs
  transient errors — a bad API key won't self-heal, so hammering wastes
  quota. The open() method now accepts an optional cooldownMs override.
- SmartDropLabs#371: Verify delivery exists in cancelRetry before attempting zrem,
  returning a structured result indicating whether the removal succeeded.

Closes SmartDropLabs#368
Closes SmartDropLabs#369
Closes SmartDropLabs#370
Closes SmartDropLabs#371
@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@ogundelevictory 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

@ritaifeoluwa
ritaifeoluwa merged commit c92f464 into SmartDropLabs:main Sep 25, 2026
2 of 3 checks passed
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