You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Flag Name
Value
Description
Default
sortRequestBody
Boolean
Whether or not to sort the request body before building a cache. This removes the need for specific ordering in request payloads.
false
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: