The service builds user profiles based on a field template and a list of local changes. After the recent PR, the behavior became unstable: some calls start affecting others, and parallel processing sometimes returns an incomplete result without any explicit error signal.
buildProfiles method accepts:
baseTemplate — the base profile field template;requests — a list of profile build requests.ProfileRequest item, the result must be built independently of the others.baseTemplate and must not affect other requests, including in subsequent service calls.profiles must match the order of the input requests list for successful elements.baseTemplate.requestId values and different updates, for example one changes tier, the other changes language.buildProfiles twice in a row with the same baseTemplate object.blocked field with the value true.Example input data:
baseTemplate.fields = {tier=basic, language=ru}
requests = [
ProfileRequest("u-1", {tier=pro}),
ProfileRequest("u-2", {language=en})
]
And a separate scenario with an error:
requests = [
ProfileRequest("u-1", {tier=pro}),
ProfileRequest("u-2", {blocked=true})
]
Profile must contain only its own changes on top of the original template.baseTemplate must produce the same result if the input data has not changed.ProfileBatchResult.errors must contain an entry with its requestId.reviewjavac / java, without frameworks or build toolsCompletableFuture and ForkJoinPool.commonPool()blocked=true in updates means a validation error for a specific requestUse line comments to explain the problem, its impact, the fix and how to test it.