(dev/core#635) CRM_Utils_Cache::nack() - Fix format #13514
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #13500.
Before
CRM_Utils_Cache::nack()
returns an array with a value namednack
.After
CRM_Utils_Cache::nack()
returns a string.Comments
The code was originally written with the intent of returning a string.
However, there was a slight copy-paste error which caused it to return an
array (which contained that string). Functionally, that worked (because
the array met the same minimum uniqueness constraint and support comparison checks),
but it's weird to read/inspect, and we should change quickly before
something else locks-in the odd structure.
The more unique the nack-value is, the more correct the nack-checking
pattern is. Appending a static-counter is a simple, fast way to provide
stronger uniqueness within a page-view.
There may be some obscure edge-cases in which the previous pattern was not
sufficiently unique -- e.g. combining tiers-of-tiers or
decorators-of-decorators. I haven't verified that, but it seems
unimportant given that the static-counter is so straightforward.
In
NaiveHasTrait
, the extraht
suffix was an attempt to increase theuniquness. However, the static-counter seems better.