2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-07-04 14:10:52 +00:00
Files
InvenTree/src
Oliver d8cac9bb61 Make plugin registry hash independent of plugin discovery order (#12151) (#12152)
* Make plugin registry hash independent of plugin discovery order

calculate_plugin_hash() iterates self.plugins.items() in insertion
order, which is the plugin discovery order of the local process. Two
processes can hold the same registry state (same plugins, versions,
active flags) in a different order and compute different hashes,
ping-ponging the _PLUGIN_REGISTRY_HASH setting and triggering endless
registry reloads in check_reload().

Sort by slug before hashing so the hash represents the registry state
rather than the iteration order of any particular process. Add a
regression test that reverses the plugin dict and asserts the hash is
unchanged.

* Address review comments: explicit sort key, guard against vacuous test

---------

Co-authored-by: Christopher Johnson <keitonasawa@gmail.com>
Co-authored-by: Nasawa <christopher@anigeek.com>
2026-06-11 11:15:50 +10:00
..