Skip to content

Conversation

@kevintang513
Copy link

Summary

  • Fixed inverted conditional logic in createTransaction() function
  • Payments now correctly complete immediately and transfer balances
  • Requests now correctly remain pending until accepted/rejected

Problem

The transaction status logic in backend/database.ts:549 was inverted:

  • Payment transactions were being marked as pending instead of complete
  • Request transactions were being marked as complete instead of pending
  • Balance transfers were happening for requests (incorrect) and not for payments (incorrect)

Solution

Changed the condition from if (isRequestTransaction(transaction)) to if (!isRequestTransaction(transaction)) to properly check if a transaction is a payment.

Test Results

✅ All unit tests passing (44 passed)

  • should create a payment - now passes
  • should create a request - now passes

Files Changed

  • backend/database.ts - Fixed conditional logic (1 line)

🤖 Generated with Claude Code

devin-ai-integration bot and others added 13 commits September 16, 2025 08:10
- Extract notification badge logic from NavBar into standalone NotificationBadge component
- Add comprehensive Cypress component tests covering edge cases (negative numbers, large numbers, undefined values)
- Preserve existing data-test selector for backward compatibility with E2E tests
- Use @mui/material to match existing project dependencies
- Remove customBadge styling from NavBar component
- All 9 component tests passing including Material-UI Badge behavior verification

Co-Authored-By: [email protected] <[email protected]>
Extract NotificationBadge component and add comprehensive tests
…58009691

Revert "Extract NotificationBadge component and add comprehensive tests"
This reverts commit 531adfb.
The condition in createTransaction was inverted, causing:
- Payment transactions to be marked as 'pending' instead of 'complete'
- Request transactions to be marked as 'complete' instead of 'pending'
- Balance transfers to incorrectly happen for requests and not for payments

Changed line 549 from `if (isRequestTransaction(transaction))` to
`if (!isRequestTransaction(transaction))` to properly check if the
transaction is a payment (not a request).

This fix ensures:
- Payments: immediately complete and transfer balances
- Requests: remain pending until accepted/rejected

All unit tests now passing (44 passed).

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ kevintang513
❌ devin-ai-integration[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@cypress-app-bot
Copy link

@kevintang513 kevintang513 deleted the fix/inverted-transaction-logic branch January 20, 2026 07:04
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.

3 participants