Skip to content

Read balance error - #2

Closed
tawoe wants to merge 2 commits into
constantine2nd:developfrom
tawoe:read_balance_error
Closed

tawoe wants to merge 2 commits into
constantine2nd:developfrom
tawoe:read_balance_error

Conversation

@tawoe

@tawoe tawoe commented Apr 28, 2021

Copy link
Copy Markdown

No description provided.

@tawoe tawoe closed this Jan 26, 2022
@tawoe
tawoe deleted the read_balance_error branch January 26, 2022 14:33
constantine2nd pushed a commit that referenced this pull request Jan 6, 2026
Bug #1: getActiveCallLimitsByConsumerIdAtDate ignored the date parameter
- Always used LocalDateTime.now() instead of the provided date
- Broke queries for future dates
- API endpoint /active-rate-limits/{DATE} was non-functional

Bug #2: Hour-based caching created off-by-minute query bug
- Query truncated to start of hour (12:00:00)
- Rate limits created mid-hour (12:01:47) were not found
- Condition: fromDate <= 12:00:00 failed when fromDate = 12:01:47

Solution:
- Use the actual date parameter in getActiveCallLimitsByConsumerIdAtDate
- Query full hour range (12:00:00 to 12:59:59) instead of point-in-time
- Ensures rate limits created anytime during the hour are found

Fixes test: RateLimitsTest.scala:259 - aggregated rate limits
Expected: 15 (10 + 5), Got: -1 (not found) → Now returns: 15 ✅

See RATE_LIMITING_BUG_FIX.md for detailed analysis.
constantine2nd pushed a commit that referenced this pull request Jan 6, 2026
…zone

Bug #1: getActiveCallLimitsByConsumerIdAtDate ignored date parameter
- Used LocalDateTime.now() instead of provided date parameter
- Broke queries for future dates
- API endpoint /active-rate-limits/{DATE} was non-functional

Bug #2: Hour-based caching caused off-by-minute timing bug
- Query truncated to start of hour (12:00:00)
- Rate limits created mid-hour (12:01:47) not found
- Condition: fromDate <= 12:00:00 failed when fromDate = 12:01:47

Bug #3: Timezone mismatch between system and tests
- Code used ZoneId.systemDefault() (CET/CEST)
- Tests use ZoneOffset.UTC
- Caused hour boundary mismatches

Solution:
- Use actual date parameter in getActiveCallLimitsByConsumerIdAtDate
- Query full hour range (12:00:00 to 12:59:59) instead of point-in-time
- Use UTC timezone consistently
- Add debug logging for troubleshooting

Note: Test still failing - may be cache or transaction timing issue.
Further investigation needed.

See RATE_LIMITING_BUG_FIX.md for detailed analysis.
constantine2nd pushed a commit that referenced this pull request Feb 3, 2026
Merge pull request OpenBankProject#2676 from simonredfern/develop
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.

2 participants