After the assign(), call I expect the internal cache to be invalidated, so subsequent calls to getRolesByUser() give correct info.
What do you get instead?
The initial call to getRolesByUser() create a cache entry, but that isn't updated when assign() is called, so the subsequent call to getRolesByUser() is giving the old cached data.
Since https://github.com/yiisoft/yii2/pull/19727 has been merged, DbManager is now correctly using the cache, but this causes another issue to pop up.
It seems that
assign()
,revoke()
andrevokeAll()
don't invalidate the cache.What steps will reproduce the problem?
What is the expected result?
After the
assign()
, call I expect the internal cache to be invalidated, so subsequent calls togetRolesByUser()
give correct info.What do you get instead?
The initial call to
getRolesByUser()
create a cache entry, but that isn't updated whenassign()
is called, so the subsequent call togetRolesByUser()
is giving the old cached data.Additional info