Open djay opened 9 months ago
@davisagli I'd rather get an understanding of what its trying to do from someone who designed it. It seems to be a cache to prevent the more expensive looking up of if there is a matching override for this particular script.
@davisagli I think that it's also possible it would work the same if the key was the path of the script rather than the url path.
At least using the (possibly persistent) object as a cache key is a no go. This is the entry to hell. It must be pure luck we had not any problems so far. . Good catch!
I am just not sure if the repr
is good enough. In theory it should be OK, but I am not aware what are the edge cases we could run into.
@jensens @davisagli I've changed the key to the filesystem filename. I can't really think of a reason this is not ok but you guys might be able to. There is a problem that overriding skin scripts seems to have no tests and I'm not sure its a commonly used feature.
@davisagli is using plone as a test dependency ok? otherwise I'm struggling to come up with a test for skins
@davisagli is using plone as a test dependency ok? otherwise I'm struggling to come up with a test for skins
Skins are actually a concept of CMFCore, so it should be enough for testing purposes. For some inspiration you may want to look at it's tests there https://github.com/zopefoundation/Products.CMFCore/blob/master/src/Products/CMFCore/tests/test_SkinsTool.py
@jensens I already looked there. it doesn't test running a script. Only the skin name. So far I actually didn't find a test of the functionality of skins
I tested it on the 5.0 site thats been giving me problems. collective.memleak seems to show its fixed this problem but annoyingly the topref counts in the zmi debug control panel still seem to show the objects are there which I can't explain.
I understand, testing here is complex and there are no tests on this level available anyway. I would say it is save to merge this PR, since this is a very simple change. Any other opinions?
@djay please add an entry to the CHANGES.rst
, this is in my opinion the only missing bit preventing a merge.
@jensens ok. Shame this also didn't fix my major memory leak like I thought it would :(
Pull Request Test Coverage Report for Build 8182579628
Details
💛 - Coveralls