Skip to content

Conversation

@Shivd131
Copy link

@Shivd131 Shivd131 commented Jan 6, 2026

Description

Fixes FINERACT-2320.

The Issue:
When fineract.job.loan-cob-enabled is set to false, the API endpoint /loans/is-catch-up-running throws a JobIsNotFoundOrNotEnabledException. This results in a 403 Forbidden (or sometimes 400 Bad Request) response, causing the "Manage Jobs" UI to display an error message unnecessarily.

The Fix:
Modified LoanCOBCatchUpApiResource.java to handle the empty Service Optional gracefully. Instead of throwing an exception, the API now correctly returns 200 OK with a payload indicating the job is not running: {"catchUpRunning": false}.

Verification:

  • Reproduced the issue locally by setting export FINERACT_JOB_LOAN_COB_ENABLED=false.
  • Confirmed the API previously returned 400/403.
  • Applied the fix and confirmed via cURL that the API now returns 200 OK.
shivd@Shiv_Laptop MINGW64 ~/Documents/mifos/fineract (develop)
$ curl -k -i -u mifos:password   -H "Fineract-Platform-TenantId: default"   -X GET "https://localhost:8443/fineract-provider/api/v1/loans/is-catch-up-running"
HTTP/1.1 200 
X-Notification-Refresh: false
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Type: application/json
Content-Length: 24
Date: Tue, 06 Jan 2026 18:37:55 GMT

{"catchUpRunning":false}

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

@IOhacker
Copy link
Contributor

IOhacker commented Jan 6, 2026

@Shivd131 Run './gradlew :fineract-provider:spotlessApply' to fix these violations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please rebase, this fix is already in place

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

Please rebase

@Shivd131 Shivd131 force-pushed the fix/FINERACT-2320-catchup-status branch 2 times, most recently from 4b2ea1f to d40284d Compare January 7, 2026 05:08
@Shivd131
Copy link
Author

Shivd131 commented Jan 7, 2026

@IOhacker Thanks for the review.

I have:

  • Rebased onto the latest develop to pick up the SavingsInterestPostingTest fix.

  • Applied Spotless formatting.

The build should be green now, but kindly let me know if there are further fixes required!

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

Remove the comment

@Shivd131 Shivd131 force-pushed the fix/FINERACT-2320-catchup-status branch from d40284d to 8108047 Compare January 7, 2026 14:52
@Shivd131
Copy link
Author

Shivd131 commented Jan 7, 2026

@IOhacker I have removed the comment, thank you.

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

LGTM

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