Skip to content

fix: resolve issues #899 #900 #901 #902 - #983

Open
cephas360 wants to merge 2 commits into
WHEELBACK:mainfrom
cephas360:fix/issues-899-900-901-902
Open

cephas360 wants to merge 2 commits into
WHEELBACK:mainfrom
cephas360:fix/issues-899-900-901-902

Conversation

@cephas360

Copy link
Copy Markdown

#899 — Settlement fee calculation overflow for large amounts

  • contracts/settlement/src/lib.rs: replaced bare += with checked_add for total_weight (initialize) and approval_weight (approve_settlement) to return InvalidWeightSum instead of silently wrapping on u64 overflow.
  • COMEBACKHERE-contracts/contracts/treasury/src/lib.rs: same checked_add guards applied to initialize and approve_settlement for consistency across both contract trees.

#900 — Contract event indexer skips events at a ledger boundary

  • comebackhere-backend/src/indexer.ts: pollOnce previously set both startLedger and cursor to undefined on a fresh start (cursor === '0'), which left the RPC with no starting point and caused the first ledger's events to be skipped. Fixed by passing startLedger: 1 for the initial poll and switching to cursor-based pagination only once a real paging token has been persisted.

#901 — Compliance lookup failure treated as an approval

  • comebackhere-frontend/src/utils/compliance.ts: getAddressStatus now wraps both the network call and simulation check in explicit try/catch blocks and re-throws with unambiguous error messages that make it clear the status is unknown. Added checkAddressAllowed(), a fail-closed wrapper that returns { status: 'Blocked' } on any error so a network hiccup can never silently grant access.

#902 — Settlement webhook uses outdated invoice status

  • comebackhere-backend/src/services/treasury-indexer.ts: the settlement_executed webhook previously fired with only the raw on-chain event data before the DB write had been committed. Fixed by reading the updated settlement record from MongoDB (via findOne) immediately after processSettlementExecuted() and including the authoritative status, merchant_address, amount, and token fields in the webhook payload.

chore: update .gitignore

  • Added test snapshot patterns (.snap.bak, allure-results/allure-report/, jest-html-reporters-attach/), additional lock-file variants, OS metadata (ehthumbs.db, Desktop.ini, $RECYCLE.BIN/), temp/scratch files (.tmp, *.temp, *.bak, *.orig, .rej), debug artifacts (.cpuprofile, *.heapprofile, *.heapsnapshot), and Soroban local-dev artifacts (.soroban/, **/identity/, wasm-pack.log).

Pull Request

Summary

  • Describe the purpose of this PR in one or two sentences.

Checklist

  • PR description includes: Closes #[issue_id]
  • Tests added or updated
  • ABI snapshot updated if contract sources changed (abis/ and COMEBACKHERE-contracts/)
  • Screenshots attached if UI changed
  • Documentation updated if needed

Notes

…CK#902

WHEELBACK#899 — Settlement fee calculation overflow for large amounts
- contracts/settlement/src/lib.rs: replaced bare += with checked_add
  for total_weight (initialize) and approval_weight (approve_settlement)
  to return InvalidWeightSum instead of silently wrapping on u64 overflow.
- COMEBACKHERE-contracts/contracts/treasury/src/lib.rs: same checked_add
  guards applied to initialize and approve_settlement for consistency
  across both contract trees.

WHEELBACK#900 — Contract event indexer skips events at a ledger boundary
- comebackhere-backend/src/indexer.ts: pollOnce previously set both
  startLedger and cursor to undefined on a fresh start (cursor === '0'),
  which left the RPC with no starting point and caused the first ledger's
  events to be skipped. Fixed by passing startLedger: 1 for the initial
  poll and switching to cursor-based pagination only once a real paging
  token has been persisted.

WHEELBACK#901 — Compliance lookup failure treated as an approval
- comebackhere-frontend/src/utils/compliance.ts: getAddressStatus now
  wraps both the network call and simulation check in explicit try/catch
  blocks and re-throws with unambiguous error messages that make it clear
  the status is unknown. Added checkAddressAllowed(), a fail-closed
  wrapper that returns { status: 'Blocked' } on any error so a network
  hiccup can never silently grant access.

WHEELBACK#902 — Settlement webhook uses outdated invoice status
- comebackhere-backend/src/services/treasury-indexer.ts: the
  settlement_executed webhook previously fired with only the raw on-chain
  event data before the DB write had been committed. Fixed by reading the
  updated settlement record from MongoDB (via findOne) immediately after
  processSettlementExecuted() and including the authoritative status,
  merchant_address, amount, and token fields in the webhook payload.

chore: update .gitignore
- Added test snapshot patterns (*.snap.bak, allure-results/allure-report/,
  jest-html-reporters-attach/), additional lock-file variants, OS metadata
  (ehthumbs.db, Desktop.ini, $RECYCLE.BIN/), temp/scratch files (*.tmp,
  *.temp, *.bak, *.orig, *.rej), debug artifacts (*.cpuprofile,
  *.heapprofile, *.heapsnapshot), and Soroban local-dev artifacts
  (.soroban/, **/identity/, wasm-pack.log).
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@cephas360 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant