Skip to content

fix(backend): repair webhook delivery, analytics, and account balances - #1715

Merged
blurbeast merged 3 commits into
LabsCrypt:mainfrom
0takuc0mrade:fix/assigned-backend-issues
Oct 21, 2026
Merged

blurbeast merged 3 commits into
LabsCrypt:mainfrom
0takuc0mrade:fix/assigned-backend-issues

Conversation

@0takuc0mrade

Copy link
Copy Markdown
Contributor

Description

Fix four assigned backend issues affecting webhook delivery, historical analytics, and GraphQL account balances.

Type of Change

  • Bug fix
  • Test addition or update
  • Documentation update

Related Issues

Closes #1694
Closes #1695
Closes #1696
Closes #1697

Changes Made

  • Refresh the webhook timestamp and HMAC immediately before every HTTP attempt while retaining one logical delivery ID and unchanged payload.
  • Count only completed production deliveries when evaluating failure streaks. Exclude test pings and pending retries before limiting the history; keep successful production deliveries as streak resets.
  • Return historical averages as PostgreSQL NUMERIC strings, preserving the full fractional precision and scale without rounding. Document this behavior for hourly and daily responses.
  • Aggregate account streams with one sender-or-recipient query so self-directed streams count once. Calculate claimable funds only from incoming streams using the shared accrual calculator, including paused/inactive handling and remaining-balance caps.

Testing

  • Backend TypeScript build: cd backend && npm run build — passed.
  • Full backend suite with an isolated PostgreSQL 16 database: npm test --workspace backend -- --maxWorkers=2 --reporter=dot — 78 files passed; 924 tests passed, 6 skipped. All configured coverage thresholds passed (75.71% statements, 81.02% branches, 74.41% functions).
  • Ran the regression tests against the original upstream source: 14 failures reproduced across all four issues; restored the fixes before the passing full-suite run.
  • Webhook coverage verifies all five attempts with fake time and the default 300-second signature tolerance, stable delivery IDs, HTTP/network terminal failures, ignored test/in-flight rows, and successful-delivery streak resets.
  • HTTP coverage exercises integer-looking and fractional NUMERIC averages through both hourly and daily responses, plus outgoing-only, unvested incoming, self-directed, paused, inactive, capped, mixed, and empty GraphQL account totals.

Checklist

  • Self-review completed
  • Regression tests added and existing backend tests pass
  • Backend build passes
  • Precision behavior documented
  • All four issues linked with closing keywords

@blurbeast
blurbeast merged commit cda1c85 into LabsCrypt:main Oct 21, 2026
12 of 16 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