Normalize Bridge webhook payload envelopes#406
Merged
islandbitcoin merged 4 commits intoJun 18, 2026
Merged
Conversation
islandbitcoin
commented
Jun 17, 2026
islandbitcoin
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed the webhook envelope normalization (deposit/kyc/transfer + the ERPNext writer). The normalization approach is reasonable and the graceful-degradation logging is a nice touch. A few correctness concerns inline — the strongest are the destination_payment_rail-as-currency fallback (in two files) and a silent audit-skip in the writer.
Contributor
Author
|
Addressed in
Focused verification run:
|
…yc status type
- transfer.spec.ts now posts Bridge's real webhook envelope (event_type/event_object,
nested source.failure_reason) instead of the legacy { event, data } shape the
handler no longer reads; restores coverage for failed-cashout audit and
already_terminal paths.
- kyc.ts: cast bridgeKycStatus to Account["bridgeKycStatus"] (BridgeKycStatus was
referenced but never defined/imported).
Contributor
Author
Review comments addressed (902cafe)All five review threads resolved. Summary:
Additional fixes in this push
Verification
Out of scope (pre-existing on base, not introduced here)
|
heyolaniran
pushed a commit
to heyolaniran/flash
that referenced
this pull request
Jun 20, 2026
* fix(bridge): normalize webhook payload envelopes
* fix: key bridge deposit audit rows by stable id
* fix: handle uncreditable bridge deposit activity
* test(bridge): update transfer webhook spec to Bridge envelope + fix kyc status type
- transfer.spec.ts now posts Bridge's real webhook envelope (event_type/event_object,
nested source.failure_reason) instead of the legacy { event, data } shape the
handler no longer reads; restores coverage for failed-cashout audit and
already_terminal paths.
- kyc.ts: cast bridgeKycStatus to Account["bridgeKycStatus"] (BridgeKycStatus was
referenced but never defined/imported).
---------
Co-authored-by: Vandana <forge@getflash.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
id/customer_id,status/kyc_status).event_objectwhile keeping legacy fallback fields.Verification
git diff --checkeslint --no-ignore src/services/bridge/webhook-server/routes/deposit.ts src/services/bridge/webhook-server/routes/kyc.ts src/services/bridge/webhook-server/routes/transfer.ts src/services/frappe/BridgeTransferRequestWriter.ts