Closed arzmir closed 6 years ago
Hi @arzmir. As you mentioned, for now I'd cover this scenario with my proposal of leaving this to the user by providing a custom bodymatcher function (should be out soon).
I'm trying to avoid having to parse the body contents, if possible.
Thank you for the idea though!
@arzmir I just release v1.5.0, which adds the bodyMatcher
option.
There's an example on how to use it in the README.
Hope it helps!
Wonderful. Will take it for a test run soon.
Possibly Covered In Issue #7
Your proposal on how to handle partial body matching might also cover this issue. As one could maybe supply a deep match or body sorting function.
Problem
During some readability refactoring I wanted to sort some lines of code alphabetically, but because these were setting values for a request payload, it caused a cache miss in Talkback.
What I assume is the issue here is the payload object is unsorted when stringified. Which probably is in everyones interest for most situations in a performance perspective. But here it causes a cache miss for equal data with different ordering.
Working around the issue is no worse than rebuilding the Talkback request-response pair, but it may be tedious for bigger rounds of refactoring.
Proposal
A configuration flag for choosing to sort the body by key names. Opting for a flag as It will undoubtedly be a performance hit.
Boolean
false