Skip to content

feat: fault injection points for merchant API keys crash recovery testing - #600

Merged
adenueltech merged 2 commits into
The-Engineer-Network:mainfrom
ruthoreaji-123:fault-injection/#480
Oct 22, 2026
Merged

adenueltech merged 2 commits into
The-Engineer-Network:mainfrom
ruthoreaji-123:fault-injection/#480

Conversation

@ruthoreaji-123

Copy link
Copy Markdown
Contributor

Closes #480

The JWT auth module now supports fault injection at 4 points in the token
lifecycle to test crash recovery scenarios for the merchant API keys system.

Closes #480

ruthoreaji-123 and others added 2 commits October 22, 2026 01:25
Add fault injection points between each step of the withdrawal broadcast and
settlement pipeline to test crash recovery scenarios. Each injection point
allows simulating a crash at specific steps and verifying:
- Withdrawal remains in its last stable status
- Ledger balance is preserved
- No money is lost or duplicated on restart

The withdrawal status machine:
  pending_broadcast → broadcasting → broadcast_accepted → confirmed → completed

Fault injection points added:
  - BeforeClaim: Before claiming from pending_broadcast
  - AfterClaim: After claiming but before dispatch
  - AfterDispatch: After sender returns but before recording outcome
  - AfterRecord: After recording outcome but before status transition

Tests verify crash recovery at each point with ledger balance assertions.

Co-Authored-By: Codebuff <noreply@codebuff.com>
… testing

Add fault injection points to the JWT authentication module (issue The-Engineer-Network#480).

The JWT auth module now supports fault injection at 4 points in the token
lifecycle to test crash recovery scenarios for the merchant API keys system:

1. BeforeCreate: Before creating a new token - returns AuthError::TokenCreation
2. AfterCreate: After creating token but before returning
3. BeforeVerify: Before verifying a token - returns AuthError::InvalidToken
4. AfterVerify: After verifying token but before returning claims

Tests verify crash recovery at each point with proper error handling.

Closes The-Engineer-Network#480
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@ruthoreaji-123 is attempting to deploy a commit to the emmanuel adewunmi's projects Team on Vercel.

A member of the Team first needs to authorize it.

@adenueltech
adenueltech merged commit b238115 into The-Engineer-Network:main Oct 22, 2026
1 check failed
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.

Merchant accounts with API keys

2 participants