fix(consumer): missed consumer update due to wrong version in cache#12413
fix(consumer): missed consumer update due to wrong version in cache#12413Revolyssup merged 20 commits intoapache:masterfrom
Conversation
|
Will this pr fixed #12393? |
Yes |
|
Truth be told, I didn't understand your modifications. Can you provide more insight? 🤔 |
As this comment explains https://github.com/apache/apisix/pull/11840/files#r2193898420 My changes are a revert of the bug introducing PR + only adding expensive operation (.clone()) in the lrucache callback. |
|
Thanks for the explanation, I seem to have run into some GitHub bug that prevents the web page from pinpointing the exact comment you pointed out. |
apisix/consumer.lua
Outdated
| -- if the val is a Consumer, clone it to the local consumer; | ||
| -- if the val is a Credential, to get the Consumer by consumer_name and then clone | ||
| -- it to the local consumer. | ||
| local consumer |
There was a problem hiding this comment.
I don't prefer current code style, it not easy to read
We can put those changing code to one or two seperate functions, and check the return value if it failed
Reducing the nesting depth can make the code more readable.
Description
Fixes #12393
This PR introduced a critical bug #11840 due to which consumers are not updated until a subsequent update in credentials due to credential version being used even for checking consumer update.
More context on this comment: https://github.com/apache/apisix/pull/11840/files#r2193898420
Checklist