Fix missing donations & reduce unnecessary database calls by Sartharon · Pull Request #3715 · PhantomBot/PhantomBot · GitHub
Skip to content

Fix missing donations & reduce unnecessary database calls#3715

Merged
gmt2001 merged 1 commit into
PhantomBot:masterfrom
Sartharon:master
May 2, 2026
Merged

Fix missing donations & reduce unnecessary database calls#3715
gmt2001 merged 1 commit into
PhantomBot:masterfrom
Sartharon:master

Conversation

@Sartharon

Copy link
Copy Markdown
Contributor
  • Fix donations being missed for two reasons
    • Greatest donation_id not necessarily representing the most recent donation -> base on created_at fallback to donation_id
    • StreamLabsDonationEvent only fired if donation_id is actually larger -> instead check each entry in the returned JSON. As we only request donations starting from the last processed one and limit the requested donations this is bound by streamlabslimit or twitchalertslimit or 5 thus being negligible in terms of used CPU cycles
  • Reduce constant database calls and saves of the lastId for a minimal increase in heap memory (worth the trade off at least in my eyes, we might even reduce the heap footprint by not creating JOOQ subordinate objects this way)

@Sartharon

Copy link
Copy Markdown
Contributor Author

@gmt2001 gmt2001 enabled auto-merge May 2, 2026 14:46
@gmt2001 gmt2001 merged commit bfb5786 into PhantomBot:master May 2, 2026
8 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

Development

Successfully merging this pull request may close these issues.

2 participants