ciur / papermerge

Open Source Document Management System for Digital Archives (Scanned Documents)
https://papermerge.com
Apache License 2.0
2.55k stars 267 forks source link

Remove dependency mptt library #501

Closed ciur closed 1 year ago

ciur commented 1 year ago

Remove the dependency on the following packages:

There are couple of reasons why above dependencies should be removed:

  1. libraries are buggy and are not well maintained.
  2. standard SQL now support with recursive statement i.e. common table expressions = cte which are useful when searching through hierarchies.

mptt is especially problematic as the tree structure is maintained in application level using extra attributes (left and right) and

  1. there is a full "tree rebuild" on every insert (very dubious practice) - left/right attributes need to be updated for all nodes!
  2. If there is a bug/error while "rebuilding tree" - the whole tree may become corrupt which is to say that some folder and documents just vanish from the radar - which is to say "not good"!

The funny part is that mptt/polymorphic/polymorphic tree is very easy to replace with own code.

ciur commented 1 year ago

Work in progress...

ciur commented 1 year ago

PR papermerge/papermerge-core#107 PR papermerge/papermerge.js#37