Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groupbycriteria utility cache spills information across sites #87

Open
instification opened this issue Sep 5, 2019 · 0 comments · May be fixed by #88
Open

groupbycriteria utility cache spills information across sites #87

instification opened this issue Sep 5, 2019 · 0 comments · May be fixed by #88
Labels

Comments

@instification
Copy link
Member

instification commented Sep 5, 2019

The current method of displaying groupby criteria is to use the IGroupByCriteria utility. This is a global utility that caches its results. However, as it is a global utility it is caching results across the instance and there is no separation of sites. So if you have an instance with multiple sites, the cache will be whichever one gets processed first meaning it will break collection filters for other sites. It is also then sharing information about the indexes between sites which is a security concern.

The code in question:

if self._groupby is not None:
# The groupby criteria are used at each IBeforeTraverseEvent - so
# on each request. This has to be fast, so exit early.
return self._groupby
self._groupby = {}

Possible solution:

Instead of caching on the utility, use memoize with the site path as the key.

I'm currently working on a PR for this, but any other input/ideas are welcome @petschki, @thet

@instification instification changed the title groupbycriteria widget cache spills information across sites groupbycriteria utility cache spills information across sites Sep 5, 2019
@instification instification linked a pull request Sep 5, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant