Skip to content

fix: validate cache value before stringify, make airdrops create atomic - #419

Merged
ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
pooramara:fix/issues-388-389-390-391
Sep 25, 2026
Merged

ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
pooramara:fix/issues-388-389-390-391

Conversation

@pooramara

@pooramara pooramara commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #388
Fixes #389
Fixes #390
Fixes #391

What changed

Notes

Why

  • JSON.stringify throws on circular references and BigInt, which would crash the calling code and potentially lose the data it was trying to cache.
  • A crash between cache.set and zadd left an airdrop record invisible to list()/scanIds() (no entry in IDS_KEY) or a phantom ID in IDS_KEY with no backing record.

How to test

  • cache.set('test', { self: {} }); self.self = self; should log an error and return without crashing
  • cache.set('test', BigInt(1)); should log an error and return without crashing
  • Airdrop creation should write both the record and the ID index atomically — verify via Redis MONITOR or tests

… create atomic

- SmartDropLabs#388: Wrap JSON.stringify in try-catch in cache.set to gracefully handle circular references, BigInt, or other non-serializable values instead of crashing
- SmartDropLabs#390: Replace cache.set + redis.zadd with MULTI/EXEC in airdrops create() so crash between them can't leave orphaned records

Note: SmartDropLabs#389 (webhookEncryption deriveKey caching) and SmartDropLabs#391 (alerts create atomicity) were already addressed in prior commits.
@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@pooramara 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 3f0ad7d 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