jackrabbit-filevault icon indicating copy to clipboard operation
jackrabbit-filevault copied to clipboard

JCRVLT-810 skip filter validation

Open joerghoh opened this issue 5 months ago • 4 comments

When controlling both package creation, transport and import checking the filters in import can be time-consuming activity. For that reason it should be possible to skip the validation of the filters, as it will always match. In my test case this reduced the package import time by about 25%.

Right now it only skips the validation of properties, but we could think about skipping the validation of node paths as well. Given that in my case we had around 10 properties per node in average, skipping the filters for adding nodes will just add some small benefit on top.

joerghoh avatar Jul 23 '25 14:07 joerghoh

I moved the skip logic out of the workspace filter class, and into the DocViewImporter.

joerghoh avatar Jul 29 '25 12:07 joerghoh

Looks much better now, I think long term it makes sense to pass the full ImportOptions object to the ArtifactHandlers and also use that as argument for the DocViewImporter constructor, however that can be done outside this PR.

I am still wondering how the skipFilterChecksOnImport affect a) node/property deletions b) direct data serializations of files/folders

kwin avatar Sep 10 '25 14:09 kwin

Right now this does only affect the case when properties are added to a new node or updated on an existing node, the codepath for the deletion of properties is not affected. So for that I don't see anything which changes the result of a package installation.

Also it is only supposed to work under the assumption, that you control both the creation and the consumption of the package, and that in both cases the same filter rules are used. In other words: when matching the content of the package to the filters, the result is expected to be always true.

joerghoh avatar Sep 10 '25 14:09 joerghoh

Would be nice to cover that in a test case as well. Not only that deletion of properties no longer contained in the package still works but also that nodes below filter roots not contained in the package are still removed. Also this makes the name skipFilterChecksOnImport a bit misleading as actually the filter check is only skipped in very few cases during import.

kwin avatar Sep 10 '25 15:09 kwin