jsinovassin opened a new pull request, #890: URL: https://github.com/apache/unomi/pull/890
## Summary - Backport of #876 to `unomi-3.0.x`, re-cut from the current branch head. - `sanitizePersonalizations` built a filtered content list, used it as an emptiness test, and then added the original `personalizationRequest` to the result. A content the sanitizer had rejected therefore reached the evaluator, so the filtering layer did nothing for a request whose unsafe content sat beside a safe one. - The filtered list is now written back onto the request, so the evaluator sees what the sanitizer kept. A personalization whose contents are all rejected still falls back, as before. ## Differences from master - The unit test does not come across. `ContextJsonEndpointTest` does not exist on this line, and the `rest` module declares JUnit 4 while the master class is written against JUnit 5. Adding the class would mean adding a test dependency to the module, which is more than a backport should carry. - `ContextServletIT.testPersonalizationDropsScriptContentAndKeepsFallback` and its payload come across unchanged, and that test is the stronger oracle of the two: it drives the public endpoint, asserts the fallback variant is returned, and asserts that no file is written by the rejected content. ## Test plan - [ ] `ContextServletIT` on this branch, CI. - [ ] The mixed-contents case fails without the production line: reverting `personalizationRequest.setContents(personalizedContents)` returns the injected variant instead of the fallback. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
