Skip to content

Stop caching virtual directories if get_directory is used.

Description

Sandbox caches the virtual directory for its root. Since you can call get_virtual_directory and get_directory, it's possible to have both a virtual directory (which holds state) and the underlying directory for it. Modifying the underlying directory will then cause the virtual Directory object to contain out-of-date data.

Plugins should not use both get_directory and get_virtual_directory; I've updated the docstring for get_virtual_directory to indicate that bad things can happen if they do.

Proposed changes

Changes proposed in this merge request:

  • Stop caching the results of get_virtual_directory if get_directory is ever called.
  • Change the docstring for get_directory to indicate the problem of using both.

This merge request, when approved, will close issue/bug: #664 (closed)


Edited by Jim MacArthur

Merge request reports

Loading