Skip to content

Fix exact-balance funds check and inclusive end day in date-range history - #381

Open
devin-ai-integration[bot] wants to merge 1 commit into
bug-hunt-dryrunfrom
devin/1795028811-bug-hunt-fixes
Open

devin-ai-integration[bot] wants to merge 1 commit into
bug-hunt-dryrunfrom
devin/1795028811-bug-hunt-fixes

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Summary

Bug hunt on bug-hunt-dryrun. This fixes two bugs from dd26b00 where AccountService contradicts its own Javadoc. Each bug has a failing test in the new AccountServiceTest (Mockito unit tests).

Bug Test(s) Fix
hasSufficientFunds is documented as "balance is at least amount" but uses compareTo(amount) > 0, so withdrawing or transferring the exact balance throws Insufficient funds hasSufficientFundsIsTrueWhenBalanceEqualsAmount, withdrawingTheFullBalanceSucceeds > 0 → >= 0
getTransactionHistory(account, from, to) is documented as "both days inclusive" but uses end = to.atStartOfDay() with an exclusive isBefore(end), so the to day is dropped and a single-day range returns nothing dateRangeHistoryIncludesTransactionsOnTheEndDay, singleDayRangeReturnsThatDaysTransactions end = to.plusDays(1).atStartOfDay()

Before the fix, all 4 new tests fail (3 failures, 1 error). After the fix, ./mvnw clean test passes: 5 tests, 0 failures.

Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/1f9af0306443434dbed743aa37cafd05
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/1f9af0306443434dbed743aa37cafd05?variant=devin
Requested by: @gracejuan-star


Note

Devin errored when opening this Pull Request as gracejuan-star.
As a fallback, Devin opened this PR as itself.


Devin Review

…e history

Co-Authored-By: Grace Juan <grace.juan@cognition.ai>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Custom reviewers

  • ✨ Blast Radius Reviewer: no findings · View
  • 🛡️ API Security Reviewer: no findings · View

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

This branch has not been deployed

No deployments
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.

0 participants