fix: batch Nikshay villages request to avoid oversized GET query string - #161
Conversation
Selecting all facilities across multiple Nikshay TUs (e.g. a full
district) could push 1000+ facility IDs into a single comma-separated
GET query string, exceeding the ~8KB request-line limit enforced by
proxies/Tomcat and causing a 400 before the request ever reached the
controller (observed as a 400/OK Http failure on
/nikshay/location/villages).
getNikshayVillages now splits facilityIDs into batches of 200,
fetches them in parallel via forkJoin, and merges the responses into
the same { data: [...] } shape callers already expect, so no changes
were needed at either call site in work-location-mapping.component.ts.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Selecting all facilities across multiple Nikshay TUs (e.g. a full district) could push 1000+ facility IDs into a single comma-separated GET query string, exceeding the ~8KB request-line limit enforced by proxies/Tomcat and causing a 400 before the request ever reached the controller (observed as a 400/OK Http failure on
/nikshay/location/villages).
getNikshayVillages now splits facilityIDs into batches of 200, fetches them in parallel via forkJoin, and merges the responses into the same { data: [...] } shape callers already expect, so no changes were needed at either call site in work-location-mapping.component.ts.
📋 Description
JIRA ID:
Please provide a summary of the change and the motivation behind it. Include relevant context and details.
✅ Type of Change
ℹ️ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.